argoproj / gitops-engine

Democratizing GitOps
https://pkg.go.dev/github.com/argoproj/gitops-engine?tab=subdirectories
Apache License 2.0
1.68k stars 252 forks source link

fix: remove last-applied-configuration before diff in ssa #460

Closed leoluz closed 2 years ago

leoluz commented 2 years ago

When applying resources with SSA, sometimes last-applied-configuration are present in the live state but not always. This causes the diff to sometimes show the annotation as removed from the desired state. This is incorrect as desired state should never have the last-applied-configuration annotation provided.

To fix this bug, I am removing the annotation from the live resource as well as from the predicted live so diffs can be displayed correctly.

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

codecov[bot] commented 2 years ago

Codecov Report

Merging #460 (50e1255) into master (517c1ff) will increase coverage by 0.01%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #460      +/-   ##
==========================================
+ Coverage   55.38%   55.40%   +0.01%     
==========================================
  Files          41       41              
  Lines        4478     4480       +2     
==========================================
+ Hits         2480     2482       +2     
  Misses       1807     1807              
  Partials      191      191              
Impacted Files Coverage Δ
pkg/diff/diff.go 60.88% <100.00%> (+0.12%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication