From acec42ba1bffe9c453aa40bd7a386766aace63be Mon Sep 17 00:00:00 2001 From: Gaurav Mehta Date: Sat, 21 Nov 2020 13:39:52 +1100 Subject: [PATCH] Minor tweak to pass targetNamespace to klipper-helm job --- pkg/helm/controller.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/helm/controller.go b/pkg/helm/controller.go index cc589b4e7..3b5208412 100644 --- a/pkg/helm/controller.go +++ b/pkg/helm/controller.go @@ -154,6 +154,12 @@ func job(chart *helmv1.HelmChart) (*batch.Job, *core.ConfigMap) { if chart.DeletionTimestamp != nil { action = "delete" } + + targetNamespace := chart.Namespace + if len(chart.Spec.TargetNamespace) != 0 { + targetNamespace = chart.Spec.TargetNamespace + } + job := &batch.Job{ TypeMeta: meta.TypeMeta{ APIVersion: "batch/v1", @@ -215,6 +221,10 @@ func job(chart *helmv1.HelmChart) (*batch.Job, *core.ConfigMap) { Name: "HELM_VERSION", Value: chart.Spec.HelmVersion, }, + { + Name: "TARGET_NAMESPACE", + Value: targetNamespace, + }, }, }, },