From 2bfcf1bc0e9a031dbe5c5ff0c0e9d524da742f75 Mon Sep 17 00:00:00 2001 From: reinvantveer Date: Thu, 15 Jul 2021 09:44:25 +0200 Subject: [PATCH] wrap namespace configuration in `with` block to prevent setting it to "" Signed-off-by: reinvantveer --- charts/argo-workflows/templates/controller/workflow-rb.yaml | 4 +++- charts/argo-workflows/templates/controller/workflow-role.yaml | 4 +++- charts/argo-workflows/templates/controller/workflow-sa.yaml | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/charts/argo-workflows/templates/controller/workflow-rb.yaml b/charts/argo-workflows/templates/controller/workflow-rb.yaml index 4c72d27c..4bb6e5cc 100644 --- a/charts/argo-workflows/templates/controller/workflow-rb.yaml +++ b/charts/argo-workflows/templates/controller/workflow-rb.yaml @@ -13,6 +13,8 @@ roleRef: subjects: - kind: ServiceAccount name: {{ $.Values.workflow.serviceAccount.name }} - namespace: {{ $namespace }} + {{- with $namespace }} + namespace: {{ . }} + {{- end }} {{- end }} {{- end }} diff --git a/charts/argo-workflows/templates/controller/workflow-role.yaml b/charts/argo-workflows/templates/controller/workflow-role.yaml index bfe63af1..a5562335 100644 --- a/charts/argo-workflows/templates/controller/workflow-role.yaml +++ b/charts/argo-workflows/templates/controller/workflow-role.yaml @@ -5,7 +5,9 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: {{ template "argo-workflows.fullname" $ }}-workflow - namespace: {{ $namespace }} + {{- with $namespace }} + namespace: {{ . }} + {{- end }} rules: - apiGroups: - "" diff --git a/charts/argo-workflows/templates/controller/workflow-sa.yaml b/charts/argo-workflows/templates/controller/workflow-sa.yaml index d910ec16..f9971916 100644 --- a/charts/argo-workflows/templates/controller/workflow-sa.yaml +++ b/charts/argo-workflows/templates/controller/workflow-sa.yaml @@ -7,7 +7,9 @@ metadata: {{- with $.Values.workflow.serviceAccount.name }} name: {{ . }} {{- end }} - namespace: {{ $namespace }} + {{- with $namespace }} + namespace: {{ . }} + {{- end }} {{- with $.Values.workflow.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }}