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

feat: Ability to create custom labels for namespaces created with syncOptions CreateNamespace #443

Closed pasha-codefresh closed 2 years ago

pasha-codefresh commented 2 years ago

https://github.com/argoproj/argo-cd/issues/7799

codecov[bot] commented 2 years ago

Codecov Report

Merging #443 (df041e5) into master (2bc3fef) will increase coverage by 0.05%. The diff coverage is 60.00%.

@@            Coverage Diff             @@
##           master     #443      +/-   ##
==========================================
+ Coverage   55.22%   55.27%   +0.05%     
==========================================
  Files          41       41              
  Lines        4449     4452       +3     
==========================================
+ Hits         2457     2461       +4     
+ Misses       1803     1802       -1     
  Partials      189      189              
Impacted Files Coverage Δ
pkg/sync/sync_context.go 72.20% <60.00%> (+0.21%) :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

jannfis commented 2 years ago

Also, looking at the appropriate code in Argo CD, is there a reason we need a new modifier function and do not reuse the existing one here: https://github.com/argoproj/argo-cd/blob/2d544b42c9c41be85a7fcb25535e3013d2ae3350/controller/sync.go#L243?

This would save us an API change in gitops-engine.

pasha-codefresh commented 2 years ago

because modifier is calling only if namespace already exist, this hook is not calling when namespace not exist https://github.com/argoproj/gitops-engine/pull/443/files#diff-74e77a4722803a7d3f87b956ec81b82d3c5a0dd50de299922aa2208fec57e6e9R796

@jannfis