-
Notifications
You must be signed in to change notification settings - Fork 252
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 1880501: Adding overwrite-latest flag to index add #448
Bug 1880501: Adding overwrite-latest flag to index add #448
Conversation
c76b413
to
91b4d82
Compare
Can we have a description/summary on what we are trying to accomplish with this? Perhaps mentioning the use case/issue here would be helpful. |
@gallettilance: This pull request references Bugzilla bug 1880501, 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
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. |
91b4d82
to
46f8bbc
Compare
301a859
to
f283a55
Compare
pkg/registry/testdata/overwrite/prometheus.0.14.0/manifests/servicemonitor.crd.yaml
Outdated
Show resolved
Hide resolved
f283a55
to
c815e8a
Compare
@gallettilance: This pull request references Bugzilla bug 1880501, 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. |
/retest |
f789745
to
78f4fda
Compare
78f4fda
to
fe93629
Compare
db367fb
to
af77afb
Compare
32cc1e4
to
a4b1169
Compare
7346a0f
to
f3c5dbb
Compare
/test unit |
@@ -16,9 +16,9 @@ type ImageInput struct { | |||
metadataDir string | |||
to image.Reference | |||
from string | |||
annotationsFile *AnnotationsFile | |||
AnnotationsFile *AnnotationsFile |
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.
same: why did these become public?
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.
same as #448 (comment)
@@ -119,28 +167,38 @@ func (i *DirectoryPopulator) loadManifests(imagesToAdd []*ImageInput, mode Mode) | |||
// same package linearly. | |||
var err error | |||
var validImagesToAdd []*ImageInput | |||
|
|||
for pkg := range i.overwriteDirMap { | |||
err := i.loader.RemovePackage(pkg) |
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.
I think we want the remove / add to happen in a single transaction.
It would also be nice to not need to thread through the "overwriteImages" separately everywhere. is there a way we can we push the overwrite
option down to loadManifestReplaces
(or call loadManifestsReplaceOverwrite
if overwrite is set, etc), so that we only need to worry about overwriting when we try to insert and it fails because it already exists?
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.
we can but that requires exposing the image registry package to the registry package which today can't easily be done because of cyclic imports...
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.
I think you could avoid importing the image/registry package with a ReplacePackage(pkg string, bundle ...Bundle)
method on the loader -- still getting a single transaction at the DB level.
However, I do think that at this point, we should prioritize getting something working and merged over long-term support; partly b/c the declarative index config will supersede this work in the near future.
graphLoader: graphLoader, | ||
querier: querier, | ||
imageDirMap: imageDirMap, | ||
overwriteDirMap: overwriteDirMap, |
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.
do we need to distinguish which ones are "overwrites" up front?
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.
yeah I think it makes sense to do it upfront so we only pull the images when we need to. I think more of the registry package needs to be made public in order to make that possible but it shouldn't be too bad
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.
it reduces the amount of unit tests we can do though...
@gallettilance had already marked the bugzilla item linked to this PR as critical. Asking all reviewers to review this with highest priority as it blocks our operator verification pipelines. TIA. |
@gallettilance: This pull request references Bugzilla bug 1880501, 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. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gallettilance, njhale 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 |
1ea2d95
to
a84e891
Compare
/restest |
/retest |
This adds the ability to overwrite the latest bundle during index add in order to avoid having to remove all the bundles from the index and re-add them before being able to add the updated bundle.
a84e891
to
16b91b8
Compare
All pending comments addressed offline. /lgtm |
/retest Please review the full test history for this PR and help us cut down flakes. |
2 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. |
@gallettilance: All pull requests linked via external trackers have merged: Bugzilla bug 1880501 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. |
Description of the change:
Allow index maintainers to overwrite the latest bundle in a package on
opm index add
by adding an--overwrite-latest
option.Caveats
replaces
modeBenefits
Reviewer Checklist
/docs