Skip to content

Add DriftIgnoreRules to DiffOptions for drift detection#1224

Merged
matheuscscp merged 1 commit into
fluxcd:mainfrom
dipti-pai:add-driftignorerules-to-diffoptions
Jun 2, 2026
Merged

Add DriftIgnoreRules to DiffOptions for drift detection#1224
matheuscscp merged 1 commit into
fluxcd:mainfrom
dipti-pai:add-driftignorerules-to-diffoptions

Conversation

@dipti-pai
Copy link
Copy Markdown
Member

Wire DriftIgnoreRules into the Diff() method so that the CLI diff path (flux diff kustomization) can leverage the same field-level ignore rules already supported by the apply path.

When DriftIgnoreRules is set, Diff() compiles the rules once, delegates to hasDriftedWithIgnore instead of hasDrifted, and strips ignored fields from the returned objects so that the caller's diff output only shows meaningful drift.

Assisted-by: GitHub Copilot/Claude Opus 4.6

Related to: fluxcd/flux2#5884

Wire DriftIgnoreRules into the Diff() method so that the CLI
diff path (flux diff kustomization) can leverage the same
field-level ignore rules already supported by the apply path.

When DriftIgnoreRules is set, Diff() compiles the rules once,
delegates to hasDriftedWithIgnore instead of hasDrifted, and
strips ignored fields from the returned objects so that the
caller's diff output only shows meaningful drift.

Signed-off-by: Dipti Pai <diptipai89@outlook.com>
Assisted-by: GitHub Copilot/Claude Opus 4.6
Copy link
Copy Markdown
Member

@matheuscscp matheuscscp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@matheuscscp matheuscscp merged commit 1772891 into fluxcd:main Jun 2, 2026
14 checks passed
@matheuscscp
Copy link
Copy Markdown
Member

@dipti-pai ssa/v0.75.0 is tagged 👌

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.

2 participants