From 3eb2704c82e12d6b3ba62d5d1ead88c631dd45d3 Mon Sep 17 00:00:00 2001 From: Hector Fernandez Date: Tue, 12 Jan 2021 16:59:53 +0100 Subject: [PATCH] fix: broken upgrade path from previous versions Signed-off-by: Hector Fernandez --- .../charts/controllermanager/templates/deployments.yaml | 6 ++++++ .../charts/controllermanager/templates/webhook.yaml | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/charts/kubefed/charts/controllermanager/templates/deployments.yaml b/charts/kubefed/charts/controllermanager/templates/deployments.yaml index 8d92584b22..5e91db9b42 100644 --- a/charts/kubefed/charts/controllermanager/templates/deployments.yaml +++ b/charts/kubefed/charts/controllermanager/templates/deployments.yaml @@ -7,6 +7,9 @@ metadata: kubefed-control-plane: controller-manager {{- if .Values.controller.annotations }} annotations: + "helm.sh/hook": pre-install, pre-upgrade + "helm.sh/hook-weight": "-5" + "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation {{ toYaml .Values.controller.annotations | indent 4 }} {{- end }} spec: @@ -74,6 +77,9 @@ metadata: kubefed-admission-webhook: "true" {{- if .Values.webhook.annotations }} annotations: + "helm.sh/hook": pre-install, pre-upgrade + "helm.sh/hook-weight": "-5" + "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation {{ toYaml .Values.webhook.annotations | indent 4 }} {{- end }} spec: diff --git a/charts/kubefed/charts/controllermanager/templates/webhook.yaml b/charts/kubefed/charts/controllermanager/templates/webhook.yaml index 00c3a7555d..6b49745998 100644 --- a/charts/kubefed/charts/controllermanager/templates/webhook.yaml +++ b/charts/kubefed/charts/controllermanager/templates/webhook.yaml @@ -14,6 +14,9 @@ metadata: name: validations.core.kubefed.io {{- end }} annotations: + "helm.sh/hook": pre-install, pre-upgrade + "helm.sh/hook-weight": "-5" + "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation {{- if .Values.certManager.enabled }} cert-manager.io/inject-ca-from: {{ printf "%s/%s%s" .Release.Namespace .Release.Name "-root-certificate" | quote }} {{- end }} @@ -114,6 +117,10 @@ metadata: {{- else }} name: mutation.core.kubefed.io {{- end }} + annotations: + "helm.sh/hook": pre-install, pre-upgrade + "helm.sh/hook-weight": "-5" + "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation webhooks: - name: kubefedconfigs.core.kubefed.io clientConfig: