-
Notifications
You must be signed in to change notification settings - Fork 71
🐛 (fix) Fix race condition in Helm to Boxcutter migration during OLM upgrades #2440
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
🐛 (fix) Fix race condition in Helm to Boxcutter migration during OLM upgrades #2440
Conversation
✅ Deploy Preview for olmv1 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Pull request overview
This pull request fixes a race condition that occurs during the upgrade from standard OLM (Helm runtime) to experimental OLM (Boxcutter runtime). The issue arose because migrated ClusterExtensionRevisions were created without a Succeeded=True status condition, causing them not to be recognized as "Installed" until the ClusterExtensionRevision controller reconciled them. This timing gap led to version resolution failures during OLM upgrades.
Changes:
- Added a new
ClusterExtensionRevisionReasonMigratedconstant for tracking migration status - Set initial
Succeeded=Truestatus condition on migrated revisions immediately after creation - Enhanced documentation explaining the race condition and its resolution
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
api/v1/clusterextensionrevision_types.go |
Added new ClusterExtensionRevisionReasonMigrated constant for status condition reasons |
internal/operator-controller/applier/boxcutter.go |
Added status update logic to set Succeeded=True condition on migrated revisions with comprehensive documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2440 +/- ##
==========================================
- Coverage 69.48% 69.48% -0.01%
==========================================
Files 102 102
Lines 8249 8297 +48
==========================================
+ Hits 5732 5765 +33
- Misses 2063 2071 +8
- Partials 454 461 +7
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:
|
3f3514f to
46c7962
Compare
932f0af to
7ed8d21
Compare
7ed8d21 to
c07a0fa
Compare
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.
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.
c07a0fa to
2a26e0c
Compare
When upgrading OLM from standard (Helm runtime) to experimental (Boxcutter runtime), the BoxcutterStorageMigrator creates a ClusterExtensionRevision from the existing Helm release. However, the migrated revision was created without status conditions, causing a race condition where it wasn't recognized as "Installed". Assisted-by: CLAUDE
2a26e0c to
bdc017a
Compare
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.
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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
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.
| client. | ||
| On("List", mock.Anything, mock.AnythingOfType("*v1.ClusterExtensionRevisionList"), mock.Anything). | ||
| Run(func(args mock.Arguments) { | ||
| list := args.Get(1).(*ocv1.ClusterExtensionRevisionList) | ||
| list.Items = []ocv1.ClusterExtensionRevision{existingRev} |
Copilot
AI
Jan 30, 2026
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.
This test sets up List() but does not mock client.Get(). BoxcutterStorageMigrator.Migrate() currently calls Client.Get() when revisions exist and revision 1 is not already Succeeded=True, so this will trigger an unexpected mock call and fail the test. Either add a Get() expectation here or change ensureMigratedRevisionStatus to skip non-migrated revision 1 before calling ensureRevisionStatus (so no Get() occurs).
pedjak
left a comment
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
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tmshort The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/override codecov/patch |
|
@camilamacedo86: Overrode contexts on behalf of camilamacedo86: codecov/patch DetailsIn 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-sigs/prow repository. |
492c7e5
into
operator-framework:main
When upgrading OLM from standard (Helm runtime) to experimental (Boxcutter runtime), the
BoxcutterStorageMigratorcreates aClusterExtensionRevisionfrom the existing Helm release. However, the migrated revision was created without status conditions, causing a race condition where it wasn't recognized as "Installed".This fix sets an initial
Succeeded=Truestatus on migrated revisions, ensuring they're immediately recognized and allowing version upgrades to proceed correctly after OLM upgradesReal-World Scenario
What We're Doing
Day 1: You install OLM standard edition and install PostgreSQL operator v2.0.0
Day 2: You want to try the new Boxcutter runtime (experimental features)
Day 3: PostgreSQL v2.1.0 is released with bug fixes you need
What Was Happening (Before Fix)
The Migration Process
When OLM upgrades from Helm to Boxcutter:
4. Race condition - System checks what's installed before status is set
What's Fixed Now
After the Fix
When OLM upgrades from Helm to Boxcutter: