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

Update namespace v2 #465

Closed blakepettersson closed 1 year ago

blakepettersson commented 1 year ago

Rename WithNamespaceCreation to WithNamespaceModifier, since this method is also used for modifying existing namespaces. This method takes a single argument for the actual updating, and unless this method gets invoked by its caller no updating will take place (fulfilling what the createNamespace argument used to do).

Within autoCreateNamespace, everywhere where we previously added tasks we'll now need to check whether the namespace should be created (or modified), which is now delegated to the appendNsTask and appendFailedNsTask methods.

codecov[bot] commented 1 year ago

Codecov Report

Base: 55.46% // Head: 55.66% // Increases project coverage by +0.19% :tada:

Coverage data is based on head (48f686d) compared to base (98ccd3d). Patch coverage: 80.00% of modified lines in pull request are covered.

:exclamation: Current head 48f686d differs from pull request most recent head 57f0dd2. Consider uploading reports for the commit 57f0dd2 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #465 +/- ## ========================================== + Coverage 55.46% 55.66% +0.19% ========================================== Files 41 41 Lines 4504 4513 +9 ========================================== + Hits 2498 2512 +14 + Misses 1813 1807 -6 - Partials 193 194 +1 ``` | [Impacted Files](https://codecov.io/gh/argoproj/gitops-engine/pull/465?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=argoproj) | Coverage Δ | | |---|---|---| | [pkg/sync/sync\_context.go](https://codecov.io/gh/argoproj/gitops-engine/pull/465/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=argoproj#diff-cGtnL3N5bmMvc3luY19jb250ZXh0Lmdv) | `73.46% <80.00%> (+0.83%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=argoproj). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=argoproj)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

leoluz commented 1 year ago

@blakepettersson Tks for working on this feature! Make sure you sign off all your commits. The DCO job in our CI needs to be green before we are able to merge your PR.

blakepettersson commented 1 year ago

Make sure you sign off all your commits. The DCO job in our CI needs to be green before we are able to merge your PR.

It's been well overdue for me to add the git hook, now I've done that 😄

sonarcloud[bot] commented 1 year 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
8.6% 8.6% Duplication

leoluz commented 1 year ago

This PR introduces a breaking change in current Argo CD master. To avoid possible build issues this should be merged together with https://github.com/argoproj/argo-cd/pull/10672