Skip to content

Refactor updates to spec to use patches and Server-Side Apply (SSA) #2120

Description

@Zerpet

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestnever-staleIssue or PR marked to never go stale

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions