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 1866930: Clean up stranded bundles #413

Merged

Conversation

kevinrizza
Copy link
Member

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.

@openshift-ci-robot openshift-ci-robot added bugzilla/severity-urgent Referenced Bugzilla bug's severity is urgent 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 Aug 6, 2020
@openshift-ci-robot
Copy link

@kevinrizza: This pull request references Bugzilla bug 1866930, which is invalid:

  • expected the bug to target the "4.6.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 1866930: Clean up stranded bundles

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 Aug 6, 2020
@kevinrizza
Copy link
Member Author

/bugzilla refresh

@openshift-ci-robot
Copy link

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

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.

@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 Aug 6, 2020
Copy link
Member

@dinhxuanvu dinhxuanvu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good

Copy link
Member

@ecordell ecordell left a 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",
Copy link
Member

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()
Copy link
Member

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

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)
@kevinrizza
Copy link
Member Author

@dinhxuanvu @ecordell ptal

Copy link
Member

@dinhxuanvu dinhxuanvu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 7, 2020
@openshift-ci-robot
Copy link

[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:
  • OWNERS [dinhxuanvu,kevinrizza]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@dinhxuanvu
Copy link
Member

/hold for another review

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 7, 2020
@dinhxuanvu
Copy link
Member

/retest

@ecordell
Copy link
Member

ecordell commented Aug 7, 2020

/hold cancel
/lgtm

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 7, 2020
@kevinrizza
Copy link
Member Author

/retest

@openshift-bot
Copy link
Contributor

/retest

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

@kevinrizza
Copy link
Member Author

/test e2e-aws

1 similar comment
@kevinrizza
Copy link
Member Author

/test e2e-aws

@kevinrizza
Copy link
Member Author

/test e2e-aws

@kevinrizza
Copy link
Member Author

/retest

@openshift-merge-robot openshift-merge-robot merged commit 018a040 into operator-framework:master Aug 7, 2020
@openshift-ci-robot
Copy link

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

Bug 1866930: Clean up stranded bundles

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-urgent Referenced Bugzilla bug's severity is urgent 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