gitops-engine icon indicating copy to clipboard operation
gitops-engine copied to clipboard

fix: apply ssa namespace twice

Open blakepettersson opened this issue 2 years ago • 3 comments

In argoproj/argo-cd#13965, upgrading to client-go 0.26 uncovered an issue with existing namespaces not preserving labels and annotations when converting an existing namespace to use managedNamespaceMetadata.

From 0.26 up, in order to preserve the existing behaviour what we need to do is to first apply the existing namespace with SSA and its preexisting labels and annotations. This also needs to be applied with another manager than the default one.

After that initial apply, we proceed as normal with a ServerSideApply. This is a one-time thing for any existing namespace; we check if we need to perform this action by detecting if there is a preexisting SSA annotation on the namespace.

blakepettersson avatar Aug 17 '23 20:08 blakepettersson

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 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Aug 17 '23 21:08 sonarqubecloud[bot]

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (f15cf61) 54.63% compared to head (0115c94) 54.64%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #537   +/-   ##
=======================================
  Coverage   54.63%   54.64%           
=======================================
  Files          41       41           
  Lines        4638     4652   +14     
=======================================
+ Hits         2534     2542    +8     
- Misses       1908     1912    +4     
- Partials      196      198    +2     
Files Coverage Δ
pkg/sync/sync_context.go 73.81% <62.50%> (-0.27%) :arrow_down:

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Aug 17 '23 22:08 codecov[bot]

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 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Oct 13 '23 22:10 sonarqubecloud[bot]