Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 use spec's ref instead of canonical ref when copying catalog image #438

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

joelanford
Copy link
Member

When used in conjuction with a "tag-only" registries.conf mirror registry configuration, our containers/image unpacker fails. This is because we resolve a canonical ref from the tag, and then use the digest-based reference to actually copy the image, thus thwarting the tag-only configuration.

This commit ensures that we always copy the image using the reference provided in the spec.

When used in conjuction with a "tag-only" registries.conf mirror
registry configuration, our containers/image unpacker fails. This is
because we resolve a canonical ref from the tag, and then use the
digest-based reference to actually copy the image, thus thwarting the
tag-only configuration.

This commit ensures that we always copy the image using the reference
provided in the spec.

Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
@joelanford joelanford requested a review from a team as a code owner October 18, 2024 20:17
Copy link

codecov bot commented Oct 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 37.83%. Comparing base (d70f01f) to head (58b8eba).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #438   +/-   ##
=======================================
  Coverage   37.83%   37.83%           
=======================================
  Files          15       15           
  Lines        1208     1208           
=======================================
  Hits          457      457           
  Misses        701      701           
  Partials       50       50           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@everettraven everettraven added this pull request to the merge queue Oct 18, 2024
Merged via the queue into operator-framework:main with commit 67d3a34 Oct 18, 2024
11 of 13 checks passed
@@ -88,7 +88,7 @@ func (i *ContainersImageRegistry) Unpack(ctx context.Context, catalog *catalogdv
// copy.Image can concurrently pull all the layers.
//
//////////////////////////////////////////////////////
dockerRef, err := docker.NewReference(canonicalRef)
dockerRef, err := docker.NewReference(imgRef)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joelanford I think it would be great to have the explanation from PR description somewhere in a comment here.

Does it make sense to unit test this scenario?

@joelanford joelanford deleted the fix-pull-reference branch October 22, 2024 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants