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

Bug 1919168: when mirroring to a file destination, mount images under the index location #772

Merged
merged 1 commit into from Mar 23, 2021

Conversation

ecordell
Copy link
Contributor

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.

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.
@openshift-ci-robot openshift-ci-robot added bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels Mar 19, 2021
@openshift-ci-robot
Copy link

@ecordell: This pull request references Bugzilla bug 1919168, which is invalid:

  • expected the bug to target the "4.8.0" release, but it targets "---" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Bug 1919168: when mirroring to a file destination, mount images under the index location

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.

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 19, 2021
@ecordell
Copy link
Contributor Author

/bugzilla refresh

@openshift-ci-robot openshift-ci-robot added bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. and removed bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels Mar 19, 2021
@openshift-ci-robot
Copy link

@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
  • bug is open, matching expected state (open)
  • bug target release (4.8.0) matches configured target release for branch (4.8.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

Requesting review from QA contact:
/cc @jianzhangbjz

In response to this:

/bugzilla refresh

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
Copy link
Contributor Author

/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 {
Copy link

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

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 22, 2021
@openshift-ci-robot
Copy link

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@ecordell
Copy link
Contributor Author

/cherry-pick release-4.7

@openshift-cherrypick-robot

@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:

/cherry-pick release-4.7

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.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

3 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 314b90b into openshift:master Mar 23, 2021
@openshift-ci-robot
Copy link

@ecordell: All pull requests linked via external trackers have merged:

Bugzilla bug 1919168 has been moved to the MODIFIED state.

In response to this:

Bug 1919168: when mirroring to a file destination, mount images under the index location

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.

@openshift-cherrypick-robot

@ecordell: new pull request created: #779

In response to this:

/cherry-pick release-4.7

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants