From 60f5bbe9534a5770e1421f5db87d508ebc347af8 Mon Sep 17 00:00:00 2001 From: Ian Tewksbury Date: Tue, 18 Jul 2023 20:19:53 -0400 Subject: [PATCH] operators-installer - fix argo sync waves so that operator is installed before sync wave 0 where it is likley (due to it being default) that that is where CRs using the CRDs installed by these operators will be --- charts/operators-installer/Chart.yaml | 2 +- .../operators-installer/templates/Job_installplan-approver.yaml | 2 +- .../templates/Job_installplan-complete-verifier.yaml | 2 +- charts/operators-installer/templates/Namespace.yaml | 2 ++ charts/operators-installer/templates/OperatorGroup.yaml | 2 ++ .../templates/RoleBinding_installplan-approvers.yaml | 2 +- .../templates/Role_installplan-approver.yaml | 2 +- .../templates/ServiceAccount_installplan-approver.yaml | 2 +- charts/operators-installer/templates/Subscription.yaml | 2 ++ 9 files changed, 12 insertions(+), 6 deletions(-) diff --git a/charts/operators-installer/Chart.yaml b/charts/operators-installer/Chart.yaml index 8aff512b..4bcc1c16 100644 --- a/charts/operators-installer/Chart.yaml +++ b/charts/operators-installer/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.3.1 +version: 2.3.2 home: https://github.com/redhat-cop/helm-charts diff --git a/charts/operators-installer/templates/Job_installplan-approver.yaml b/charts/operators-installer/templates/Job_installplan-approver.yaml index cf51f16a..37af7e98 100644 --- a/charts/operators-installer/templates/Job_installplan-approver.yaml +++ b/charts/operators-installer/templates/Job_installplan-approver.yaml @@ -15,7 +15,7 @@ metadata: "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded "helm.sh/hook-weight": "20" {{- else }} - argocd.argoproj.io/sync-wave: "20" + argocd.argoproj.io/sync-wave: "-20" {{- end }} spec: completions: 1 diff --git a/charts/operators-installer/templates/Job_installplan-complete-verifier.yaml b/charts/operators-installer/templates/Job_installplan-complete-verifier.yaml index 356d65c7..d99d3af4 100644 --- a/charts/operators-installer/templates/Job_installplan-complete-verifier.yaml +++ b/charts/operators-installer/templates/Job_installplan-complete-verifier.yaml @@ -15,7 +15,7 @@ metadata: "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded "helm.sh/hook-weight": "30" {{- else }} - argocd.argoproj.io/sync-wave: "30" + argocd.argoproj.io/sync-wave: "-10" {{- end }} spec: completions: 1 diff --git a/charts/operators-installer/templates/Namespace.yaml b/charts/operators-installer/templates/Namespace.yaml index 6fbb1db8..55f3b130 100644 --- a/charts/operators-installer/templates/Namespace.yaml +++ b/charts/operators-installer/templates/Namespace.yaml @@ -7,5 +7,7 @@ metadata: name: {{ .name | default $.Release.Namespace }} labels: {{- include "operators-installer.labels" $ | nindent 4 }} + annotations: + argocd.argoproj.io/sync-wave: "-60" {{- end }} {{- end }} diff --git a/charts/operators-installer/templates/OperatorGroup.yaml b/charts/operators-installer/templates/OperatorGroup.yaml index 2a4c055c..a0a2078e 100644 --- a/charts/operators-installer/templates/OperatorGroup.yaml +++ b/charts/operators-installer/templates/OperatorGroup.yaml @@ -8,6 +8,8 @@ metadata: namespace: {{ .name | default $.Release.Namespace }} labels: {{- include "operators-installer.labels" $ | nindent 4 }} + annotations: + argocd.argoproj.io/sync-wave: "-50" spec: targetNamespaces: {{- if .targetOwnNamespace }} diff --git a/charts/operators-installer/templates/RoleBinding_installplan-approvers.yaml b/charts/operators-installer/templates/RoleBinding_installplan-approvers.yaml index d970a76f..9edd85a8 100644 --- a/charts/operators-installer/templates/RoleBinding_installplan-approvers.yaml +++ b/charts/operators-installer/templates/RoleBinding_installplan-approvers.yaml @@ -14,7 +14,7 @@ metadata: "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded "helm.sh/hook-weight": "10" {{- else }} - argocd.argoproj.io/sync-wave: "10" + argocd.argoproj.io/sync-wave: "-30" {{- end }} roleRef: apiGroup: rbac.authorization.k8s.io diff --git a/charts/operators-installer/templates/Role_installplan-approver.yaml b/charts/operators-installer/templates/Role_installplan-approver.yaml index 4960bff9..0e984854 100644 --- a/charts/operators-installer/templates/Role_installplan-approver.yaml +++ b/charts/operators-installer/templates/Role_installplan-approver.yaml @@ -14,7 +14,7 @@ metadata: "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded "helm.sh/hook-weight": "10" {{- else }} - argocd.argoproj.io/sync-wave: "10" + argocd.argoproj.io/sync-wave: "-30" {{- end }} rules: - apiGroups: diff --git a/charts/operators-installer/templates/ServiceAccount_installplan-approver.yaml b/charts/operators-installer/templates/ServiceAccount_installplan-approver.yaml index 2b16895b..1e0b66bf 100644 --- a/charts/operators-installer/templates/ServiceAccount_installplan-approver.yaml +++ b/charts/operators-installer/templates/ServiceAccount_installplan-approver.yaml @@ -14,6 +14,6 @@ metadata: "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded "helm.sh/hook-weight": "10" {{- else }} - argocd.argoproj.io/sync-wave: "10" + argocd.argoproj.io/sync-wave: "-30" {{- end }} {{- end }} diff --git a/charts/operators-installer/templates/Subscription.yaml b/charts/operators-installer/templates/Subscription.yaml index 32b90579..17086e36 100644 --- a/charts/operators-installer/templates/Subscription.yaml +++ b/charts/operators-installer/templates/Subscription.yaml @@ -8,6 +8,8 @@ metadata: namespace: {{ .namespace | default $.Release.Namespace }} labels: {{- include "operators-installer.labels" $ | nindent 4 }} + annotations: + argocd.argoproj.io/sync-wave: "-40" spec: channel: {{ .channel }} installPlanApproval: {{ .installPlanApproval }}