From e7dbba634cc54e97e66314ef16858cbbad37583f Mon Sep 17 00:00:00 2001 From: Soam Vasani Date: Tue, 6 Feb 2018 15:06:21 -0800 Subject: [PATCH] Helm hook bugfixes: run on upgrade, delete on completion (#473) --- charts/fission-all/templates/post-install-job.yaml | 5 +++-- charts/fission-core/templates/post-install-job.yaml | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/charts/fission-all/templates/post-install-job.yaml b/charts/fission-all/templates/post-install-job.yaml index fd723e91..f5c99ea1 100644 --- a/charts/fission-all/templates/post-install-job.yaml +++ b/charts/fission-all/templates/post-install-job.yaml @@ -13,7 +13,8 @@ metadata: annotations: # This is what defines this resource as a hook. Without this line, the # job is considered part of the release. - "helm.sh/hook": post-install + "helm.sh/hook": post-install,post-upgrade + "helm.sh/hook-delete-policy": hook-succeeded spec: template: metadata: @@ -26,5 +27,5 @@ spec: containers: - name: post-install-job image: "fission/alpinecurl" - command: ["sh", "-c", "/Usr/bin/curl -m 5 -H \"Content-Type: application/json\" -X POST -d '{\"type\": \"helm-post-install\", \"chartName\": \"{{ .Chart.Name }}\", \"chartName\": \"{{ .Chart.Version }}\"}' https://g.fission.sh/analytics || true"] + command: ["sh", "-c", "/Usr/bin/curl -m 5 -H \"Content-Type: application/json\" -X POST -d '{\"type\": \"helm-post-install\", \"chartName\": \"{{ .Chart.Name }}\", \"chartVersion\": \"{{ .Chart.Version }}\"}' https://g.fission.sh/analytics || true"] {{ end }} diff --git a/charts/fission-core/templates/post-install-job.yaml b/charts/fission-core/templates/post-install-job.yaml index d81eb7bd..dd4e2d9d 100644 --- a/charts/fission-core/templates/post-install-job.yaml +++ b/charts/fission-core/templates/post-install-job.yaml @@ -13,7 +13,8 @@ metadata: annotations: # This is what defines this resource as a hook. Without this line, the # job is considered part of the release. - "helm.sh/hook": post-install + "helm.sh/hook": post-install,post-upgrade + "helm.sh/hook-delete-policy": hook-succeeded spec: template: metadata: @@ -26,5 +27,5 @@ spec: containers: - name: post-install-job image: "fission/alpinecurl" - command: ["sh", "-c", "/usr/bin/curl -m 5 -H \"Content-Type: application/json\" -X POST -d '{\"type\": \"helm-post-install\", \"chartName\": \"{{ .Chart.Name }}\", \"chartName\": \"{{ .Chart.Version }}\"}' https://g.fission.sh/analytics || true"] + command: ["sh", "-c", "/usr/bin/curl -m 5 -H \"Content-Type: application/json\" -X POST -d '{\"type\": \"helm-post-install\", \"chartName\": \"{{ .Chart.Name }}\", \"chartVersion\": \"{{ .Chart.Version }}\"}' https://g.fission.sh/analytics || true"] {{ end }}