Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Correctly calculate diffs for CRDs with ignore overrides #9092

Merged
merged 4 commits into from
Apr 13, 2022

Conversation

leoluz
Copy link
Collaborator

@leoluz leoluz commented Apr 13, 2022

Signed-off-by: Leonardo Luz Almeida leonardo_almeida@intuit.com

There was a problem when checking the ignore difference configuration for CRDs manifests. The problem is related to the fact that all CRDs will be automatically configured with resource overrides and that configuration was making application diff configs to be discarded. This PR will, instead, merge all diff configs available in settings with the Application's ones and use that merged object to determine how to calculate diffs.

This PR partially addresses the issue reported in #9071

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).
  • 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.
  • Optional. My organization is added to USERS.md.
  • 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).

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
@codecov
Copy link

codecov bot commented Apr 13, 2022

Codecov Report

Merging #9092 (0fca717) into master (2e0b2a1) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #9092      +/-   ##
==========================================
- Coverage   45.48%   45.46%   -0.02%     
==========================================
  Files         217      217              
  Lines       25655    25667      +12     
==========================================
+ Hits        11669    11670       +1     
- Misses      12357    12371      +14     
+ Partials     1629     1626       -3     
Impacted Files Coverage Δ
util/argo/diff/ignore.go 100.00% <100.00%> (ø)
applicationset/services/scm_provider/github.go 63.52% <0.00%> (-17.65%) ⬇️
applicationset/services/scm_provider/utils.go 88.50% <0.00%> (+4.59%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2e0b2a1...0fca717. Read the comment docs.

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Copy link
Member

@crenshaw-dev crenshaw-dev left a comment

Choose a reason for hiding this comment

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

lgtm!

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
@crenshaw-dev crenshaw-dev merged commit db54756 into argoproj:master Apr 13, 2022
wojtekidd pushed a commit to wojtekidd/argo-cd that referenced this pull request Apr 25, 2022
…oj#9092)

* fix: Correctly calculate diffs for CRDs with ignore overrides

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* Fix unit-test

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* Fix typo

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* Better test-case description

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Signed-off-by: wojtekidd <wojtek.cichon@protonmail.com>
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