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
Bug 1919168: when mirroring to a file destination, mount images under the index location #772
Conversation
when mirroring an index image: quay.io/my/index:a that contains a reference to another image: quay.io/other/bundle:1 to a local file: file:///local/index the referenced images are now mounted under the location for the index itself, resulting in (for example): file:///local/index/my/index:a file:///local/index/my/index/other/bundle:1 this fixes a bug where the next step of an airgap mirror can't find the images to be mirrored. as a side effect, this keeps all catalog content stored under the same fs location. Local file storage can be shared with other mirrored images while keeping it simple to copy the full contents of an index to another location.
@ecordell: This pull request references Bugzilla bug 1919168, which is invalid:
Comment In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/bugzilla refresh |
@ecordell: This pull request references Bugzilla bug 1919168, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/retest |
@@ -129,11 +129,21 @@ func imagesFromDb(file string) (map[string]struct{}, error) { | |||
} | |||
|
|||
func mappingForImages(images map[string]struct{}, src, dest imagesource.TypedImageReference, maxComponents int) (mapping map[imagesource.TypedImageReference]imagesource.TypedImageReference, errs []error) { | |||
// don't do any name mangling when not mirroring to a real registry | |||
// this allows us to assume the names are preserved when doing multi-hop mirrors that use a file or s3 as an | |||
// intermediate step | |||
if dest.Type != imagesource.DestinationRegistry { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking this on after pairing on it!
Only thing I'm wondering is since we have dest.Type != imagesource.DestinationRegistry
multiple times if there is a way to abstract this out by having the dest type fulfill an interface that includes a mappingForImages
function so it's a bit more abstract. Not really worth it at this point, but maybe in the future if the mapping starts to drift more between the different destinations.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ecordell, exdx The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest Please review the full test history for this PR and help us cut down flakes. |
/cherry-pick release-4.7 |
@ecordell: once the present PR merges, I will cherry-pick it on top of release-4.7 in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/retest Please review the full test history for this PR and help us cut down flakes. |
3 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
@ecordell: All pull requests linked via external trackers have merged: Bugzilla bug 1919168 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@ecordell: new pull request created: #779 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
when mirroring an index image:
quay.io/my/index:a
that contains a reference to another image:
quay.io/other/bundle:1
to a local file:
file:///local/index
the referenced images are now mounted under the location for the index
itself, resulting in (for example):
file:///local/index/my/index:a
file:///local/index/my/index/other/bundle:1
this fixes a bug where the next step of an airgap mirror can't find the
images to be mirrored.
as a side effect, this keeps all catalog content stored under the same
fs location. Local file storage can be shared with other mirrored
images while keeping it simple to copy the full contents of an index
to another location.