RING-50689 // Create Scality UI Status - #31
Closed
hervedombya wants to merge 4 commits into
Closed
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new status subsystem for the ScalityUI custom resource, adding conditions and phases to track reconciliation state and errors.
- Adds status update logic with conditions and phases in a new helper (
scalityui_status.go) - Integrates status initialization and updates into the main reconcile loop (
scalityui_controller.go) and extends tests - Updates CRD and API types to include
phaseandconditionsfields, and ensures deep copies for the new status fields
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| internal/controller/scalityui_status.go | Implements condition- and phase-based status updates |
| internal/controller/scalityui_controller.go | Hooks status init, progressing, and error reporting into Reconcile |
| internal/controller/scalityui_controller_test.go | Adds a test block for status conditions and phases |
| config/crd/bases/ui.scality.com_scalityuis.yaml | Extends CRD schema to define .status.phase and .status.conditions |
| api/v1alpha1/scalityui_types.go | Adds Phase and Conditions fields to ScalityUIStatus |
| api/v1alpha1/zz_generated.deepcopy.go | Ensures deep copy logic includes the new Conditions slice |
Comments suppressed due to low confidence (3)
internal/controller/scalityui_status.go:87
- The progressing condition treats a nil deployment as 'Deployment stable', which could misrepresent missing resources. Add an explicit check for missing resources before marking progression as false.
setScalityUICondition(scalityui, ConditionTypeProgressing, metav1.ConditionFalse, ReasonProgressing, "Deployment stable", now)
internal/controller/scalityui_controller_test.go:716
- The new status conditions and phase logic are not validated in tests; consider adding assertions that verify the CR's
status.Conditionsandstatus.Phasereflect expected states after reconciliation.
Describe("Status Conditions and Phases", func() {
internal/controller/scalityui_status.go:197
- [nitpick] The default message 'Operation successful' in
setScalityUIConditionWithErrormay be misleading when marking a progressing condition; consider deriving the message from the reason or accepting a custom message.
message := "Operation successful"
| ) | ||
|
|
||
| // updateScalityUIStatus updates the ScalityUI status | ||
| func (r *ScalityUIReconciler) updateScalityUIStatus(ctx context.Context, scalityui *uiscalitycomv1alpha1.ScalityUI) error { |
Collaborator
There was a problem hiding this comment.
This status reconciler could also be used for others CR, maybe we can extract the Phase and Status to their own struct, make ScalityUI extending that struct and attach this reconciller to that speicifc Status sub CR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.