From a64998322824cd6dc00795ee893a4b3913658354 Mon Sep 17 00:00:00 2001 From: Darren Shepherd Date: Thu, 7 Mar 2019 11:26:46 -0700 Subject: [PATCH] Any change to helm chart values or values.yaml should upgrade --- pkg/helm/controller.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/helm/controller.go b/pkg/helm/controller.go index ca86f1e5a8..e396d8be97 100644 --- a/pkg/helm/controller.go +++ b/pkg/helm/controller.go @@ -2,6 +2,8 @@ package helm import ( "context" + "crypto/sha256" + "encoding/hex" "fmt" "sort" @@ -22,7 +24,7 @@ import ( const ( namespace = "kube-system" - image = "rancher/klipper-helm:v0.1.2" + image = "rancher/klipper-helm:v0.1.3" label = "helm.k3s.cattle.io/chart" ) @@ -124,6 +126,7 @@ func (h *handler) onRemove(chart *k3s.HelmChart) (runtime.Object, error) { func job(chart *k3s.HelmChart) (*batch.Job, *core.ConfigMap) { oneThousand := int32(1000) + valuesHash := sha256.Sum256([]byte(chart.Spec.ValuesContent)) action := "install" if chart.DeletionTimestamp != nil { @@ -170,6 +173,10 @@ func job(chart *k3s.HelmChart) (*batch.Job, *core.ConfigMap) { Name: "REPO", Value: chart.Spec.Repo, }, + { + Name: "VALUES_HASH", + Value: hex.EncodeToString(valuesHash[:]), + }, }, }, },