Summary
The operator currently updates spec fields in the RabbitmqCluster custom resource using full Update() calls, and in some cases performs updates even when no change is needed. This can:
Proposal
- Refactor all operator logic updating
spec to use targeted patches with Server-Side Apply (SSA)
- Assign granular field ownership (with appropriate fieldManager names) only to the fields the operator is responsible for
- Avoid taking ownership of fields the operator does not intend to manage
- Update only fields that truly need to change, bypassing updates when the desired and current state are identical
Benefits
- Minimizes risk of SSA and Helm/Argo conflicts
- Ensures clean and predictable field ownership
- Reduces risk of breaking user expectations by overwriting fields
- Streamlines and documents proper patch and field ownership usage for contributors
Context
This change follows the lessons from issue #2098 (SSA conflicts on Helm upgrades) and recommendations emerging from recent code and process discussions. See Kubernetes documentation on Server-Side Apply for reference.
See also: "Move defaulting logic to a mutating webhook" (separate proposal for admission-time defaults).
Summary
The operator currently updates
specfields in the RabbitmqCluster custom resource using fullUpdate()calls, and in some cases performs updates even when no change is needed. This can:reconcileOperatorDefaultsperforms unnecessary full Update on RabbitmqCluster CR, causing Helm SSA conflicts #2098)Proposal
specto use targeted patches with Server-Side Apply (SSA)Benefits
Context
This change follows the lessons from issue #2098 (SSA conflicts on Helm upgrades) and recommendations emerging from recent code and process discussions. See Kubernetes documentation on Server-Side Apply for reference.
See also: "Move defaulting logic to a mutating webhook" (separate proposal for admission-time defaults).