Skip to content

Conversation

pjiang-dev
Copy link
Contributor

@pjiang-dev pjiang-dev commented Jul 16, 2025

fixes argoproj/argo-cd#17362 (comment)

When ignoreDifferences normalization removes fields before server-side apply, it causes validation errors because required fields (like image) are missing from the config sent to the Kubernetes API.

To avoid this issue we will

  1. Skip the normalizer (ignoreDifferences) with a new option applyIgnoreDifference when performing server-side apply --dry-run
  2. After predictedLive is performed, we can now normalize (ignoreDifferences) the config and live
  3. Result will be a diff without those ignoreDifferences fields

Copy link

codecov bot commented Jul 17, 2025

Codecov Report

Attention: Patch coverage is 44.44444% with 10 lines in your changes missing coverage. Please review.

Project coverage is 47.22%. Comparing base (8849c3f) to head (8489316).
Report is 54 commits behind head on master.

Files with missing lines Patch % Lines
pkg/diff/diff.go 53.84% 4 Missing and 2 partials ⚠️
pkg/diff/diff_options.go 20.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #747      +/-   ##
==========================================
- Coverage   54.26%   47.22%   -7.05%     
==========================================
  Files          64       64              
  Lines        6164     6529     +365     
==========================================
- Hits         3345     3083     -262     
- Misses       2549     3191     +642     
+ Partials      270      255      -15     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pjiang-dev pjiang-dev force-pushed the pjiang/ignorediff-ssd branch from c229d82 to 164adfc Compare July 17, 2025 05:58
Signed-off-by: Peter Jiang <[email protected]>
@pjiang-dev pjiang-dev marked this pull request as ready for review July 17, 2025 06:21
@pjiang-dev pjiang-dev requested a review from a team as a code owner July 17, 2025 06:21
@pjiang-dev pjiang-dev changed the title WIP fix: update normalization for ignoreDifferences on server-side diff fix: update normalization for ignoreDifferences on server-side diff Jul 17, 2025
Copy link
Contributor

@leoluz leoluz left a comment

Choose a reason for hiding this comment

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

PR is missing tests.

Copy link

Copy link
Contributor

@leoluz leoluz left a comment

Choose a reason for hiding this comment

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

LGTM

@leoluz leoluz merged commit 38f73a7 into argoproj:master Jul 24, 2025
4 of 5 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.

Server-Side Diff with RespectIgnoreDifferences can fail diff due to missing required fields
3 participants