🐛 OCPBUGS-78455: fix(boxcutter): detect collision when duplicate package is installed after upgrade#2578
Conversation
✅ Deploy Preview for olmv1 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Pull request overview
Fixes a Boxcutter collision-detection bypass that could allow a second ClusterExtension to install the same package after the first ClusterExtension upgraded and bumped managed-object revision numbers.
Changes:
- Treat
ActionProgressedresults as collisions when the reconciled object is controller-owned by a differentClusterExtensionRevision(foreign ownerRef). - Add an E2E scenario covering “upgrade then duplicate install” and a new step to ensure both
ClusterExtensionresources are cleaned up. - Add unit tests validating the new “foreign revision ownerRef” collision behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
internal/operator-controller/controllers/clusterextensionrevision_controller.go |
Adds foreign-ownerRef collision detection for ActionProgressed objects and tracks sibling CER names during reconcile. |
internal/operator-controller/controllers/clusterextensionrevision_controller_test.go |
Adds unit coverage for foreign/sibling/non-CER controller ownerRef cases. |
test/e2e/steps/steps.go |
Adds a step to track the currently-applied ClusterExtension for cleanup when a scenario applies a second CE. |
test/e2e/features/update.feature |
Adds an E2E scenario asserting collisions are detected after an upgrade when installing a duplicate CE. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
internal/operator-controller/controllers/clusterextensionrevision_controller.go
Outdated
Show resolved
Hide resolved
internal/operator-controller/controllers/clusterextensionrevision_controller.go
Outdated
Show resolved
Hide resolved
a73cf6d to
8b504c8
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2578 +/- ##
==========================================
+ Coverage 67.81% 67.94% +0.12%
==========================================
Files 137 137
Lines 9588 9617 +29
==========================================
+ Hits 6502 6534 +32
+ Misses 2586 2584 -2
+ Partials 500 499 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
internal/operator-controller/controllers/clusterextensionrevision_controller.go
Outdated
Show resolved
Hide resolved
8b504c8 to
36f661c
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
internal/operator-controller/controllers/clusterextensionrevision_controller_test.go
Outdated
Show resolved
Hide resolved
36f661c to
2b87748
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
internal/operator-controller/controllers/clusterextensionrevision_controller.go
Outdated
Show resolved
Hide resolved
internal/operator-controller/controllers/clusterextensionrevision_controller.go
Outdated
Show resolved
Hide resolved
internal/operator-controller/controllers/clusterextensionrevision_controller_test.go
Outdated
Show resolved
Hide resolved
6ad05bf to
b7f071a
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
internal/operator-controller/controllers/clusterextensionrevision_controller.go
Outdated
Show resolved
Hide resolved
internal/operator-controller/controllers/clusterextensionrevision_controller.go
Outdated
Show resolved
Hide resolved
b7f071a to
4bc4776
Compare
4bc4776 to
b3688d3
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
internal/operator-controller/controllers/clusterextensionrevision_controller.go
Outdated
Show resolved
Hide resolved
b3688d3 to
296ffe3
Compare
Problem
After upgrading a ClusterExtension (e.g., v1.0.0 → v1.0.1), installing a
second ClusterExtension with the same package succeeds instead of being
blocked. Boxcutter reports
ActionProgressedinstead ofActionCollisionbecause the objects are already owned by the upgraded revision.
Solution
During collision detection, check
ActionProgressedobjects for controllerownerRefs pointing to a ClusterExtensionRevision from a different
ClusterExtension. Treat these as collisions.
Before
Two ClusterExtensions referencing the same package both reach
Installed: Trueafter an upgrade on the first one.
After
The second ClusterExtension is blocked with
Progressing: True / Reason: Retryingand a message containing
revision object collisionsandConflicting Owner.Motivated by: https://redhat.atlassian.net/browse/OCPBUGS-78455