-
Notifications
You must be signed in to change notification settings - Fork 81
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
CLID-265,CLID-259: generates folders based on the filtered catalog digest #945
base: main
Are you sure you want to change the base?
Conversation
@aguidirh: This pull request references CLID-265 which is a valid jira issue. 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 openshift-eng/jira-lifecycle-plugin repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aguidirh 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 |
@aguidirh: This pull request references CLID-265 which is a valid jira issue. This pull request references CLID-259 which is a valid jira issue. 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 openshift-eng/jira-lifecycle-plugin repository. |
@aguidirh: all tests passed! 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-sigs/prow 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.
Hi @aguidirh
A few comments and nits...
As you say in the description, the complexity is becoming high, but we can solve this gradually.
I think that the rebuild is happening twice, because prepareM2D is saving both to the cache and to the destination registry.
we need to discuss what to do in order not to rebuild twice, and not to push multiple times...
right now, I still cant test catalog rebuild properly, because all rebuilds hit the error: OCPBUGS-44281:
"[linux/ppc64le]: creating build container: copying system image from manifest list: Source image rejected: A signature was required, but no signature exists"
localDest = dockerProtocol + strings.Join([]string{o.LocalFQDN, imgSpec.PathComponent}, "/") + ":" + imgSpec.Tag | ||
remoteDest = strings.Join([]string{o.Destination, imgSpec.PathComponent}, "/") + ":" + imgSpec.Tag | ||
} | ||
srcCache := dockerProtocol + strings.Join([]string{o.LocalFQDN, imgSpec.PathComponent}, "/") + ":" + filepath.Base(filteredDir) |
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.
Hi Alex,
I thought about this too, and I solved this a little differently in #947
Actually, if you take the copyImageSchema that comes from the items in catalogSchema.AllImages, the src ref, dest ref and origin ref are already calculated by the collector, and can simply be reused.
localDest = dockerProtocol + strings.Join([]string{o.LocalFQDN, imgSpec.PathComponent}, "/") + ":" + imgSpec.Tag | ||
remoteDest = strings.Join([]string{o.Destination, imgSpec.PathComponent}, "/") + ":" + imgSpec.Tag | ||
} | ||
srcCache := dockerProtocol + strings.Join([]string{o.LocalFQDN, imgSpec.PathComponent}, "/") + ":" + filepath.Base(filteredDir) |
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.
srcCache := dockerProtocol + strings.Join([]string{o.LocalFQDN, imgSpec.PathComponent}, "/") + ":" + filepath.Base(filteredDir) | |
updatedDest := strings.Join([]string{o.LocalFQDN, imgSpec.PathComponent}, "/") + ":" + filepath.Base(filteredDir) | |
srcCache := dockerProtocol + updatedDest |
digestOnly := digest.String() | ||
if strings.Contains(digestOnly, ":") { | ||
digestOnly = strings.Split(digest.String(), ":")[1] | ||
} |
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.
digestOnly := digest.String() | |
if strings.Contains(digestOnly, ":") { | |
digestOnly = strings.Split(digest.String(), ":")[1] | |
} | |
digestOnly := digest.Encoded() |
Description
This PR generates the folders based on the digest of the operator catalog filtered. Using the digest of the filtered catalog allows oc-mirror to identify if the operator catalog was already rebuilt previously, avoiding in this way rebuilding again unnecessarily.
With this approach will be also possible to filter a catalog based on the original catalog saved on the local cache.
The operator collector currently is a little complex and the refactorings to make it easier to understand and maintain will be handled in a separated PR.
Fixes CLID-265
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
With the following ImageSetConfiguration:
I ran mirrorToDisk:
And diskToMirror
And MirrorToMirror
Expected Outcome
All the flows above should pass successfully.
NOTE: Delete, targetTag and targetCatalog were not tested yet.