Add SSA condition helpers: ConditionsFromStatus and SetApplyConfigurationStatusCondition#326
Add SSA condition helpers: ConditionsFromStatus and SetApplyConfigurationStatusCondition#326fwiesel wants to merge 1 commit into
Conversation
Introduces two helpers used by controllers that apply status via SSA: - ConditionsFromStatus: converts []metav1.Condition to the apply-config slice form, preserving ObservedGeneration on each entry so that the taint controller's skip-check (which gates on ObservedGeneration) does not silently regress. - SetApplyConfigurationStatusCondition: upserts a condition entry. Guards against nil/empty Type to prevent a panic when a caller omits the Type field. Propagates ObservedGeneration when updating an existing entry, not just on insert. Both helpers have full unit-test coverage in conditions_test.go.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Merging this branch will increase overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files
|
|
The helpers have been folded into the ssa branch directly (#302). The branch is no longer needed. |
Introduces two helpers in
internal/utils/conditions.goneeded by controllers that manage status via Server-Side Apply:ConditionsFromStatus: converts[]metav1.Conditionto the apply-config slice, preservingObservedGenerationon each entry (the taint controller's skip-check gates on it).SetApplyConfigurationStatusCondition: upserts a condition entry; guards against nil/emptyTypeto prevent panics; propagatesObservedGenerationwhen updating an existing entry.Full unit-test coverage in
conditions_test.go.Prerequisite for:
ssaandrework-onboarding.