From 5516734cca5d420df11971e8d4810f58b149b81e Mon Sep 17 00:00:00 2001 From: "Weiyanli Chen(York)" <6115189+cwyl02@users.noreply.github.com> Date: Wed, 18 May 2022 16:32:58 -0400 Subject: [PATCH] fix: add pre-upgrade hook to rbac resources (#1511) Signed-off-by: York Chen --- charts/spark-operator-chart/Chart.yaml | 2 +- charts/spark-operator-chart/templates/rbac.yaml | 6 ++++-- charts/spark-operator-chart/templates/serviceaccount.yaml | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/charts/spark-operator-chart/Chart.yaml b/charts/spark-operator-chart/Chart.yaml index b305847f6b..789ef017ab 100644 --- a/charts/spark-operator-chart/Chart.yaml +++ b/charts/spark-operator-chart/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: spark-operator description: A Helm chart for Spark on Kubernetes operator -version: 1.1.22 +version: 1.1.23 appVersion: v1beta2-1.3.6-3.1.1 keywords: - spark diff --git a/charts/spark-operator-chart/templates/rbac.yaml b/charts/spark-operator-chart/templates/rbac.yaml index 192c013bc9..56ddc1e081 100644 --- a/charts/spark-operator-chart/templates/rbac.yaml +++ b/charts/spark-operator-chart/templates/rbac.yaml @@ -4,8 +4,9 @@ kind: ClusterRole metadata: name: {{ include "spark-operator.fullname" . }} annotations: - "helm.sh/hook": pre-install + "helm.sh/hook": pre-install, pre-upgrade "helm.sh/hook-delete-policy": hook-failed, before-hook-creation + "helm.sh/hook-weight": "-10" labels: {{- include "spark-operator.labels" . | nindent 4 }} rules: @@ -112,8 +113,9 @@ kind: ClusterRoleBinding metadata: name: {{ include "spark-operator.fullname" . }} annotations: - "helm.sh/hook": pre-install + "helm.sh/hook": pre-install, pre-upgrade "helm.sh/hook-delete-policy": hook-failed, before-hook-creation + "helm.sh/hook-weight": "-10" labels: {{- include "spark-operator.labels" . | nindent 4 }} subjects: diff --git a/charts/spark-operator-chart/templates/serviceaccount.yaml b/charts/spark-operator-chart/templates/serviceaccount.yaml index fb5591ba54..2a5e4f208f 100644 --- a/charts/spark-operator-chart/templates/serviceaccount.yaml +++ b/charts/spark-operator-chart/templates/serviceaccount.yaml @@ -4,8 +4,9 @@ kind: ServiceAccount metadata: name: {{ include "spark-operator.serviceAccountName" . }} annotations: - "helm.sh/hook": pre-install + "helm.sh/hook": pre-install, pre-upgrade "helm.sh/hook-delete-policy": hook-failed, before-hook-creation + "helm.sh/hook-weight": "-10" {{- with .Values.serviceAccounts.sparkoperator.annotations }} {{ toYaml . | indent 4 }} {{- end }}