Skip to content

ssa: add DriftIgnoreRules to ApplyOptions for field-level ignore on apply#1157

Open
dipti-pai wants to merge 1 commit intofluxcd:mainfrom
dipti-pai:ssa-ignore-rules
Open

ssa: add DriftIgnoreRules to ApplyOptions for field-level ignore on apply#1157
dipti-pai wants to merge 1 commit intofluxcd:mainfrom
dipti-pai:ssa-ignore-rules

Conversation

@dipti-pai
Copy link
Copy Markdown
Member

@dipti-pai dipti-pai commented Mar 31, 2026

Changes include

  • Add []jsondiff.IgnoreRule to ssa ApplyOptions
  • Change has no effect in create code paths. In Apply and ApplyAll code paths that correspond to update, remove ignored fields matching the ignored rules from the object.

Includes tests for various scenarios for optional and mandatory fields, claiming shared/forceful ownership and orphaning owned fields without a manager.

  1. When drift ignore rules are specified for optional fields:
  • flux manager drops ownership of the ignored fields.
  • If another manager co-owned or claimed force ownership, the field values are set accordingly.
  • If no field manager is present, the field is dropped and garbage collected by Kubernetes.
  1. When drift ignore rules are specified for mandatory fields:
  • If another manager co-owned or claimed ownership of the fields forcefully, Flux drops ownership of the field. Once Flux drops ownership, the other manager cannot drop ownership of the mandatory field, they get an error.
  • If no other manager claims ownership of the fields, flux cannot drop ownership of the field and returns an error.

Associated kustomize controller draft PR testing the changes from controller perspective - fluxcd/kustomize-controller#1627

Fixes: #696

@dipti-pai dipti-pai requested a review from stefanprodan as a code owner March 31, 2026 20:39
@dipti-pai dipti-pai marked this pull request as draft March 31, 2026 20:42
…pply

Signed-off-by: Dipti Pai <diptipai89@outlook.com>
@dipti-pai dipti-pai marked this pull request as ready for review April 1, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend ssa.Apply with field ignore rules

3 participants