-
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 1866930: Clean up stranded bundles #413
Bug 1866930: Clean up stranded bundles #413
Conversation
@kevinrizza: This pull request references Bugzilla bug 1866930, 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 |
@kevinrizza: This pull request references Bugzilla bug 1866930, 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. |
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.
Looking good
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.
looks good, just a couple of minor concerns to address
func newRegistryPruneStrandedCmd() *cobra.Command { | ||
rootCmd := &cobra.Command{ | ||
Use: "prune-stranded", | ||
Short: "prune an operator registry DB of stranded bundles", |
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.
nit: I believe docker uses the word dangling
for this, which might help users understand the issue. But doesn't need to change.
require.NoError(t, rows.Close()) | ||
|
||
// prune the orphaned bundle | ||
removedBundles, err := store.RemoveStrandedBundles() |
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 this should test the case where multiple bundles are stranded since that's a big part of the pruning
0926ec9
to
d760101
Compare
Currently, it is possible in opm to strand one or more bundles if a new bundle is added to a channel without replaces set. When this happens, `registry/index rm` can have unexpected behavior, because of the loss of the channel entry table rows linking the bundle to a package. To resolve this problem for, this commit introduces a new command `prune-stranded` which explicity removes all stranded bundles from the database. In addition, it updates `rm` to remove all stranded bundles whenever a package is being removed. Additionally, this commit fixes a bug whereby the bundlepath field was not being set on the properties table specifically for olm.gvk properties. A migration has also been provided to pull that data over when it was provided (which is the case for every bundle image added via opm)
d760101
to
e144a57
Compare
@dinhxuanvu @ecordell ptal |
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dinhxuanvu, kevinrizza 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 |
/hold for another review |
/retest |
/hold cancel |
/retest |
/retest Please review the full test history for this PR and help us cut down flakes. |
/test e2e-aws |
1 similar comment
/test e2e-aws |
/test e2e-aws |
/retest |
@kevinrizza: All pull requests linked via external trackers have merged: operator-framework/operator-registry#413. Bugzilla bug 1866930 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. |
Currently, it is possible in opm to strand one or more bundles if a new
bundle is added to a channel without replaces set. When this happens,
registry/index rm
can have unexpected behavior, because of the loss ofthe channel entry table rows linking the bundle to a package.
To resolve this problem for, this commit introduces a new command
prune-stranded
which explicity removes all stranded bundles fromthe database. In addition, it updates
rm
to remove all strandedbundles whenever a package is being removed.