Skip to content

fix(gitops-engine): apply HideSecretData to server-side diff results for Secrets#27598

Merged
agaudreault merged 19 commits intoargoproj:masterfrom
pjiang-dev:fix/mutation-webhook-changes
Apr 30, 2026
Merged

fix(gitops-engine): apply HideSecretData to server-side diff results for Secrets#27598
agaudreault merged 19 commits intoargoproj:masterfrom
pjiang-dev:fix/mutation-webhook-changes

Conversation

@pjiang-dev
Copy link
Copy Markdown
Contributor

@pjiang-dev pjiang-dev commented Apr 29, 2026

Fixes #25260

Summary

Fixes Secret resources showing persistent OutOfSync status when using IncludeMutationWebhook=true with mutation webhooks.

Problem

After sync, the live Secret already contains the webhook-mutated value. On the next server-side diff, Argo CD performs dry-run SSA, which also runs the webhook and produces predictedLive. Logically, predictedLive should match live. But for core Secrets, the webhook-mutated data can differ at the raw comparison level between the dry-run result and the actual live object. Argo CD compares those bytes and marks the resource OutOfSync.

Solution

Use HideSecretData during ServerSideDiff to ensure after mutating webhook modifies secret that data is symmetrical before comparison if secret values are identical

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Title of the PR
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

downfa11 and others added 13 commits April 16, 2026 23:06
Signed-off-by: downfa11 <downfa11@naver.com>
Signed-off-by: downfa11 <downfa11@naver.com>
Signed-off-by: downfa11 <downfa11@naver.com>
Signed-off-by: downfa11 <downfa11@naver.com>
Signed-off-by: downfa11 <downfa11@naver.com>
Signed-off-by: downfa11 <downfa11@naver.com>
Signed-off-by: downfa11 <downfa11@naver.com>
Signed-off-by: downfa11 <downfa11@naver.com>
Signed-off-by: downfa11 <downfa11@naver.com>
Signed-off-by: downfa11 <downfa11@naver.com>
Signed-off-by: downfa11 <downfa11@naver.com>
Signed-off-by: downfa11 <downfa11@naver.com>
Signed-off-by: Peter Jiang <peterjiang823@gmail.com>
@pjiang-dev pjiang-dev requested a review from a team as a code owner April 29, 2026 19:04
@bunnyshell
Copy link
Copy Markdown

bunnyshell Bot commented Apr 29, 2026

❌ Preview Environment deleted from Bunnyshell

Available commands (reply to this comment):

  • 🚀 /bns:deploy to deploy the environment

@pjiang-dev pjiang-dev changed the title Fix/mutation webhook changes fix(controller): apply HideSecretData to server-side diff results for Secrets Apr 29, 2026
Signed-off-by: Peter Jiang <peterjiang823@gmail.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.59%. Comparing base (7c582df) to head (691eb89).
⚠️ Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
gitops-engine/pkg/diff/diff.go 66.66% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #27598      +/-   ##
==========================================
- Coverage   63.65%   63.59%   -0.07%     
==========================================
  Files         417      417              
  Lines       57079    57134      +55     
==========================================
  Hits        36336    36336              
- Misses      17353    17402      +49     
- Partials     3390     3396       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pjiang-dev pjiang-dev marked this pull request as draft April 29, 2026 20:40
pjiang-dev and others added 4 commits April 29, 2026 14:37
Signed-off-by: Peter Jiang <peterjiang823@gmail.com>
Signed-off-by: Peter Jiang <peterjiang823@gmail.com>
Signed-off-by: Peter Jiang <peterjiang823@gmail.com>
Signed-off-by: Peter Jiang <35584807+pjiang-dev@users.noreply.github.com>
@pjiang-dev pjiang-dev marked this pull request as ready for review April 29, 2026 23:22
@pjiang-dev pjiang-dev changed the title fix(controller): apply HideSecretData to server-side diff results for Secrets fix(gitops-engine): apply HideSecretData to server-side diff results for Secrets Apr 29, 2026
Comment thread gitops-engine/pkg/diff/diff.go Outdated
Signed-off-by: Peter Jiang <peterjiang823@gmail.com>
@pjiang-dev pjiang-dev requested a review from agaudreault April 30, 2026 21:03
Copy link
Copy Markdown
Member

@agaudreault agaudreault left a comment

Choose a reason for hiding this comment

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

LGTM

@agaudreault agaudreault merged commit a7b70b5 into argoproj:master Apr 30, 2026
28 checks passed
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.

Secrets become OutOfSync with ServerSideDiff=true,IncludeMutationWebhook=true

3 participants