diff --git a/clustergroup/templates/plumbing/applications.yaml b/clustergroup/templates/plumbing/applications.yaml index c9a6667d..4f959379 100644 --- a/clustergroup/templates/plumbing/applications.yaml +++ b/clustergroup/templates/plumbing/applications.yaml @@ -1,3 +1,4 @@ +{{- $c := 1 | int64 }} {{- if not (eq .Values.enabled "core") }} {{- $namespace := print $.Values.global.pattern "-" $.Values.clusterGroup.name }} {{- if (eq .Values.enabled "plumbing") }} @@ -123,6 +124,8 @@ metadata: namespace: {{ $namespace }} finalizers: - resources-finalizer.argocd.argoproj.io/foreground + annotations: + argocd.argoproj.io/sync-wave: {{ quote $c |}} spec: destination: name: {{ $.Values.clusterGroup.targetCluster }} @@ -213,6 +216,7 @@ spec: # selfHeal: true {{- end }} --- +{{ $c = add1 $c }} {{- end }} {{- end }} {{- end }} diff --git a/tests/clustergroup-normal.expected.yaml b/tests/clustergroup-normal.expected.yaml index 4d740ac8..67e3fd3a 100644 --- a/tests/clustergroup-normal.expected.yaml +++ b/tests/clustergroup-normal.expected.yaml @@ -502,6 +502,8 @@ metadata: namespace: mypattern-example finalizers: - resources-finalizer.argocd.argoproj.io/foreground + annotations: + argocd.argoproj.io/sync-wave: "1" spec: destination: name: in-cluster @@ -553,6 +555,8 @@ metadata: namespace: mypattern-example finalizers: - resources-finalizer.argocd.argoproj.io/foreground + annotations: + argocd.argoproj.io/sync-wave: "2" spec: destination: name: in-cluster diff --git a/tests/clustergroup.expected.diff b/tests/clustergroup.expected.diff index 45fca30b..9408c857 100644 --- a/tests/clustergroup.expected.diff +++ b/tests/clustergroup.expected.diff @@ -241,7 +241,7 @@ roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole -@@ -45,16 +257,583 @@ +@@ -45,16 +257,587 @@ - kind: ServiceAccount # This is the {ArgoCD.name}-argocd-application-controller name: example-gitops-argocd-application-controller @@ -493,6 +493,8 @@ + namespace: mypattern-example + finalizers: + - resources-finalizer.argocd.argoproj.io/foreground ++ annotations: ++ argocd.argoproj.io/sync-wave: "1" +spec: + destination: + name: in-cluster @@ -544,6 +546,8 @@ + namespace: mypattern-example + finalizers: + - resources-finalizer.argocd.argoproj.io/foreground ++ annotations: ++ argocd.argoproj.io/sync-wave: "2" +spec: + destination: + name: in-cluster @@ -828,7 +832,7 @@ --- # Source: pattern-clustergroup/templates/plumbing/argocd.yaml apiVersion: argoproj.io/v1alpha1 -@@ -65,7 +844,7 @@ +@@ -65,7 +848,7 @@ # Changing the name affects the ClusterRoleBinding, the generated secret, # route URL, and argocd.argoproj.io/managed-by annotations name: example-gitops @@ -837,7 +841,7 @@ annotations: argocd.argoproj.io/compare-options: IgnoreExtraneous spec: -@@ -94,10 +873,10 @@ +@@ -94,10 +877,10 @@ --set global.repoURL=$ARGOCD_APP_SOURCE_REPO_URL --set global.targetRevision=$ARGOCD_APP_SOURCE_TARGET_REVISION --set global.namespace=$ARGOCD_APP_NAMESPACE @@ -852,7 +856,7 @@ --set clusterGroup.name=example --post-renderer ./kustomize"] applicationSet: -@@ -174,11 +953,59 @@ +@@ -174,11 +957,59 @@ kind: ConsoleLink metadata: name: example-gitops-link