forked from argoproj/argo-cd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(controller): make managed namespaces more 'prune-proof' (argoproj…
…#13999) * fix: make managed namespaces more 'prune-proof' In the cases where someone would want to set resource tracking on a managed namespace, or if someone would want to migrate from having a namespace in Git to using `managedNamespaceMetadata`, we need to take steps to ensure that the namespace does not get pruned. In order to do that, we add the live namespace to the list of `targetObjs` (so that it's considered a part of the source even though it's not). Finally, we need to also ensure that the managed namespace is not considered `OutOfSync` (due to the same reason as above). This is a subset of argoproj#11350, the main difference being that this commit does not set resource tracking on its own, but can be opted into if people choose to do so. Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com> * refactor: extract managed namespace check Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com> --------- Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
- Loading branch information
1 parent
b70487a
commit e1617bb
Showing
6 changed files
with
162 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
test/e2e/testdata/guestbook-with-plain-namespace-manifest/guestbook-ui-deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: guestbook-ui | ||
labels: | ||
test: "true" | ||
spec: | ||
replicas: 0 | ||
revisionHistoryLimit: 3 | ||
selector: | ||
matchLabels: | ||
app: guestbook-ui | ||
template: | ||
metadata: | ||
labels: | ||
app: guestbook-ui | ||
spec: | ||
containers: | ||
- image: quay.io/argoprojlabs/argocd-e2e-container:0.2 | ||
imagePullPolicy: IfNotPresent | ||
name: guestbook-ui | ||
ports: | ||
- containerPort: 80 |
9 changes: 9 additions & 0 deletions
9
test/e2e/testdata/guestbook-with-plain-namespace-manifest/guestbook-ui-namespace.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: guestbook-ui-with-namespace-manifest | ||
labels: | ||
test: "true" | ||
annotations: | ||
foo: bar | ||
something: else |
10 changes: 10 additions & 0 deletions
10
test/e2e/testdata/guestbook-with-plain-namespace-manifest/guestbook-ui-svc.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: guestbook-ui | ||
spec: | ||
ports: | ||
- port: 80 | ||
targetPort: 80 | ||
selector: | ||
app: guestbook-ui |