Repository navigation
scope overwrite_from_index_token for containerized architecture - #1388
Conversation
…h-scoped Docker auth (#1370) Fixes CLOUDDST-32419 and CLOUDDST-32824 by applying the overwrite token only where worker Docker config cannot already pull the image, and by avoiding blanket token stamping that broke unrelated private fragments and namespace template credentials. Co-authored-by: Tulsi Chandwani <tchandwa@tchandwa.users.ipa.redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
cca5101 (#1370) landed the scoping primitives -- docker_config_has_path_auth_for_image, get_images_needing_overwrite_token and the list-aware set_registry_token -- and converted the old worker architecture to use them. The containerized handlers were left on the pre-fix pattern, so CLOUDDST-32419 and CLOUDDST-32824 still reproduce on every request routed to build_containerized_*. Port the call sites, applying the token only where worker Docker config cannot already pull the image: - build_containerized_add: the bundle resolve stamped from_index rather than the bundles it actually pulls, so a private same-namespace bundle failed while an unrelated namespace lost its template credentials. Scope it to the bundles instead. _opm_registry_add pulls every bundle again after that window has closed and was entirely unguarded; give it the same scoped window over the digest-resolved specs. - build_containerized_fbc_operations: collapse the per-fragment loop of unfiltered context managers into one scoped window, and pass from_index down to opm_registry_add_fbc_fragment_containerized. - opm_operations.opm_registry_add_fbc_fragment_containerized: takes from_index and scopes the extract loop, which pulls each fragment. set_registry_token no-ops on an empty list, so one window covers both the "some fragments need the token" and "none do" cases. The utils import stays function-local -- utils imports get_list_bundles from this module, so a top-level import would be circular. - Opm.set_opm_version reads a label off from_index via skopeo inspect and was unguarded in add, rm and fbc-operations; a private index failed there before reaching any of the above. Wrap all three. from_index auth is deliberately not stamped at the bundle and fragment resolve steps: those calls do not pull the index. prepare_request_for_build and the later from_index accessors carry the token for the index itself. utils.set_registry_auths gains a docstring note that it restores the iib_docker_config_template baseline on exit rather than the configuration in place on entry, so nesting it inside another credential window drops that outer window's auths. No caller does this today; the note is to keep it that way. Tests seed _load_docker_config_auths with a registry-only key to confirm that registry-level auth does not count as path-scoped coverage. The two rm tests that reach the credential path now mock set_registry_token -- previously they called through to the real set_registry_auths, which writes to the developer's ~/.docker/config.json. build_containerized_merge is intentionally left for a follow-up. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Yashvardhan Nanavati <yashn@bu.edu>
PR Summary by QodoScope overwrite tokens across containerized image pulls
AI Description
Diagram
High-Level Assessment
Files changed (13)
|
|
🤖 Finished Review · ✅ Success · Started 11:33 AM UTC · Completed 12:03 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $11.30 |
Code Review by Qodo
1. Private bundle pulls fail despite token
|
|
Risk Assessment: moderate (2/5) DetailsModerate risk: the PR spans 13 files with 1157 lines and a large blast radius, but is a focused cherry-pick of a token-scoping fix extended to containerized workflows, has no security-sensitive or CI changes, carries a near-threshold test ratio of 0.46, and touches historically fix-heavy modules with low recent churn. |
ReviewFindingsMedium
Low
Next steps:
|
There was a problem hiding this comment.
Note: The following review comments could not be posted on the diff (GitHub returned 422) and are included here instead:
iib/workers/tasks/opm_operations.py(file-level): Line 1529 · [low] edge-case
opm_deprecatetruncate calls set_registry_token with append=False. The new namespace fallback logic is an unintended behavior change for this call site.
tests/test_workers/test_tasks/test_utils.py(file-level): Line 1503 · [low] documentation-comment-format
test_set_registry_token_multiple_images has no docstring while adjacent tests added by the same PR do.
Suggested fix: Add a one-line docstring.
|
🤖 Finished Retro · ✅ Success · Started 6:06 AM UTC · Completed 6:23 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $4.63 |
Retro Analysis: PR #1388Timeline
Review Finding QualityThe review agent produced 8 findings. Verification against source code:
Precision: 50% (4 valid, 3 false positive, 1 uncertain). Key Observations
Evidence for Existing Issues
Proposals skipped (target repo not allowed)File manually or update
|
master