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 1841885: Support airgapped mirroring with oc adm catalog mirror
#611
Bug 1841885: Support airgapped mirroring with oc adm catalog mirror
#611
Conversation
@ecordell: This pull request references Bugzilla bug 1841885, which is valid. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
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. |
/assign @sallyom |
56646a8
to
10cc374
Compare
/retest |
1 similar comment
/retest |
@ecordell: This pull request references Bugzilla bug 1841885, which is valid. 3 validation(s) were run on this bug
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: The following test failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
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.
This PR should add examples to the catalog mirror command help:
oc adm catalog mirror quay.io/my/image:latest file://local-catalog
and then
oc adm catalog mirror file://local-catalog some-registry:5000/local-catalog
I'm not seeing any examples of this in the documentation, either. (I'm not sure the above is the correct use but the correct way to mirror to disk then from disk to registry should be documented)
I'm wondering why oc adm catalog mirror
varies from oc adm release mirror
in ways that should be similar, for example, why is there no --to-dir
or --to
flag? To mirror to directory w/ oc adm release mirror
you can either:
oc adm mirror 4.5.0 --to-dir=release
and the output shows the user this:
To upload local images to a registry, run:
oc image mirror --from-dir=release 'file://openshift/release:4.5.0*' REGISTRY/REPOSITORY
or oc adm mirror 4.5.0 --to file://release
and output is shown:
To upload local images to a registry, run:
oc image mirror 'file://release:4.5.0*' REGISTRY/REPOSITORY
Without the added examples or documentation on how to mirror to local disk and from local disk, it would be very difficult for users to use the oc adm mirror catalog
command in this way.
pkg/cli/admin/catalog/mirror.go
Outdated
@@ -157,6 +157,16 @@ func (o *MirrorCatalogOptions) Complete(cmd *cobra.Command, args []string) error | |||
} | |||
o.DestRef = destRef | |||
|
|||
// do not modify image names which storing in file:// |
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.
which/when
pkg/cli/admin/catalog/mirror.go
Outdated
for k, v := range mapping { | ||
if _, err := w.WriteString(fmt.Sprintf("%s=%s\n", k, v.WithTag)); err != nil { | ||
to := v | ||
// render with a tag when mirroring so that the target registry doesn't GC the image |
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.
GC to garbage collect? maybe most don't know what GC is
} | ||
if err := ioutil.WriteFile(filepath.Join(dir, "catalogSource.yaml"), catalogSource, os.ModePerm); err != nil { | ||
return fmt.Errorf("error writing CatalogSource") | ||
} |
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.
Should these files be uniquely named - icsp.yaml, catalogSource.yaml, mapping.txt? (I see "imageContentSourcePolicy.yaml" is not part of this PR) See how the signature file is named here: https://github.com/openshift/oc/blob/master/pkg/cli/admin/release/mirror.go#L302-#L313 and a PR to add the writing of icsp file w/ oc adm release mirror
will also use this pattern to name the icsp file. Won't these files be overwritten when mirror cmd is run more than once, and is this a potential problem?
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.
the manifests all go into a directory, so I copied what must-gather does and added a timestamp to the containing folder
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.
sg, and like you said below, we can align oc adm catalog mirror
with oc adm release mirror
in a follow-up PR if necessary.
Thanks for the review @sallyom! I think I have addressed all of your feedback, with the exception of:
For now I have added an output like you suggested indicating what the next step should be to mirror back to a registry from files. It's probably worth looking at differences between oc adm release mirror and oc adm catalog mirror and attempting to align them more in the future, but I'd like to keep this PR scoped to addressing the BZ. |
/lgtm |
/retest |
5 similar comments
/retest |
/retest |
/retest |
/retest |
/retest |
/approve |
/retest |
/test e2e-cmd |
/retest Please review the full test history for this PR and help us cut down flakes. |
11 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. |
/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. |
/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. |
/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. |
/hold Tests which seem unrelated are flaking consistently |
The failures are not related to this PR, from what I've manually checked: |
@soltysh: Overrode contexts on behalf of soltysh: ci/prow/e2e-cmd 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. |
/retest |
2 similar comments
/retest |
/retest |
@ecordell: All pull requests linked via external trackers have merged: Bugzilla bug 1841885 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. |
/cherry-pick release-4.6 |
@ecordell: #611 failed to apply on top of branch "release-4.6":
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 to a file,
oc adm catalog mirror
will not rename any images. This means that image names can be inferred from the index contents when mirroring back out of a file store later.Airgap mirroring then becomes a two step:
This required a few changes: