wrap namespace configuration in with block to prevent setting it to ""

Signed-off-by: reinvantveer <rein.van.t.veer@geodan.nl>
This commit is contained in:
reinvantveer 2021-07-15 09:44:25 +02:00
parent 094cd02860
commit 2bfcf1bc0e
3 changed files with 9 additions and 3 deletions

View file

@ -13,6 +13,8 @@ roleRef:
subjects:
- kind: ServiceAccount
name: {{ $.Values.workflow.serviceAccount.name }}
namespace: {{ $namespace }}
{{- with $namespace }}
namespace: {{ . }}
{{- end }}
{{- end }}
{{- end }}

View file

@ -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:
- ""

View file

@ -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 }}