-
Notifications
You must be signed in to change notification settings - Fork 68
🌱 ClusterExtensionRevision conditions #2281
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
base: main
Are you sure you want to change the base?
🌱 ClusterExtensionRevision conditions #2281
Conversation
✅ Deploy Preview for olmv1 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
/hold wip |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2281 +/- ##
==========================================
+ Coverage 70.32% 70.38% +0.06%
==========================================
Files 90 90
Lines 8794 8813 +19
==========================================
+ Hits 6184 6203 +19
- Misses 2196 2197 +1
+ Partials 414 413 -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
Show resolved
Hide resolved
internal/operator-controller/controllers/clusterextensionrevision_controller.go
Show resolved
Hide resolved
internal/operator-controller/controllers/clusterextensionrevision_controller.go
Show resolved
Hide resolved
|
[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.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
8a1a5d4 to
496d418
Compare
496d418 to
8c97bd7
Compare
16c6ada to
6f1271c
Compare
6f1271c to
16c6ada
Compare
Signed-off-by: Per G. da Silva <pegoncal@redhat.com>
…ble|Unavailable) helper methods for improved code readability
16c6ada to
ef00449
Compare
…rator Start busybox's httpd and serves probes from created files
ef00449 to
370f203
Compare
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.go
Outdated
Show resolved
Hide resolved
internal/operator-controller/controllers/clusterextensionrevision_controller.go
Outdated
Show resolved
Hide resolved
db396e5 to
370f203
Compare
* added `.status.activeRevisions` for tracking * `Progressing` is mirrored from the counterpart of the latest revision * `Available` is mirrored from the counterpart of the latest installed revision * If the latest revision is rolled out, but not yet available, its `Available` condition is mirrored under its `activeRevision` entry.
370f203 to
1622df1
Compare
Signed-off-by: Per G. da Silva <pegoncal@redhat.com>
Signed-off-by: Per G. da Silva <pegoncal@redhat.com>
The logic present in private `reconcile` function of `ClusterExtensionReconciler` is refactored into step-oriented approach for increased modularity, so that Helm and Boxcutter based approaches can be wired, implemented, and tested in an easier way.
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 PR refactors the ClusterExtension reconciliation process to use a step-based architecture and updates condition handling to use Available and Progressing conditions instead of the legacy Installed condition. The changes support better status reporting from ClusterExtensionRevision objects and introduce an ActiveRevisions status field.
Key changes:
- Introduces a step-based reconciliation pattern using
ReconcileStepFuncto break down the reconcile logic into composable steps - Updates CRD printer columns and status types to use
Availableinstead ofInstalledcondition - Adds
Progressingcondition to ClusterExtensionRevision with new reasons likeRollingOut,RolloutError, andRolledOut - Introduces
ActiveRevisionsstatus field to track active revisions in ClusterExtension status - Adds new test data for v1.0.2 test-operator bundle with httpd-based container setup
Reviewed Changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
internal/operator-controller/controllers/clusterextension_reconcile_steps.go |
New file implementing generic reconcile steps for finalizers, revision states, metadata retrieval, bundle unpacking, and application |
internal/operator-controller/controllers/boxcutter_reconcile_steps.go |
New file with boxcutter-specific reconcile steps including storage migration and condition mirroring |
internal/operator-controller/controllers/clusterextension_controller.go |
Refactored to remove inline reconcile logic, moved to step-based architecture with ReconcileSteps |
internal/operator-controller/controllers/clusterextensionrevision_controller.go |
Updated condition handling to use new helper methods and improved status messages with version information |
api/v1/clusterextensionrevision_types.go |
Added helper methods for marking revision status and new condition constants |
api/v1/clusterextension_types.go |
Added RevisionStatus type and ActiveRevisions field to status |
| CRD manifests | Updated printer columns from Installed to Available and added ActiveRevisions schema |
| Test files | Updated to use new reconciler setup pattern with options, updated expected conditions |
| Test data | Added v1.0.2 bundle with httpd container setup and updated v1.0.0/v1.2.0 bundles |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
| if acnd := apimeta.FindStatusCondition(r.Conditions, ocv1.ClusterExtensionRevisionTypeAvailable); pcnd.Status == metav1.ConditionFalse && acnd != nil && acnd.Status != metav1.ConditionTrue { | ||
| apimeta.SetStatusCondition(&rs.Conditions, *acnd) | ||
| } |
Copilot
AI
Nov 5, 2025
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.
Potential nil pointer dereference: pcnd may be nil when accessed in the condition check on line 146. The code checks if pcnd != nil on line 143, but then uses pcnd.Status on line 146 without re-checking if pcnd is nil. If pcnd is nil, this will cause a panic. Add a nil check for pcnd before accessing its Status field.
| } | |
| if acnd := apimeta.FindStatusCondition(r.Conditions, ocv1.ClusterExtensionRevisionTypeAvailable); pcnd.Status == metav1.ConditionFalse && acnd != nil && acnd.Status != metav1.ConditionTrue { | |
| apimeta.SetStatusCondition(&rs.Conditions, *acnd) | |
| } | |
| if acnd := apimeta.FindStatusCondition(r.Conditions, ocv1.ClusterExtensionRevisionTypeAvailable); pcnd.Status == metav1.ConditionFalse && acnd != nil && acnd.Status != metav1.ConditionTrue { | |
| apimeta.SetStatusCondition(&rs.Conditions, *acnd) | |
| } | |
| } |
| } | ||
| } | ||
|
|
||
| if !rres.InTransistion() { |
Copilot
AI
Nov 5, 2025
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.
Corrected spelling of 'InTransistion' to 'InTransition'.
| if !rres.InTransistion() { | |
| if !rres.InTransition() { |
Description
Reviewer Checklist