compress namespaces from controller.workflowNamespaces and workflow.namespace into single loop iteration
Signed-off-by: reinvantveer <rein.van.t.veer@geodan.nl>
This commit is contained in:
parent
e07ca6dee7
commit
1a2c4b6388
1 changed files with 3 additions and 14 deletions
|
@ -28,22 +28,11 @@ rules:
|
|||
|
||||
{{- if .Values.workflow.rbac.create -}}
|
||||
|
||||
{{- if .Values.controller.workflowNamespaces }}
|
||||
{{- range .Values.controller.workflowNamespaces}}
|
||||
{{ $namespace := . }}
|
||||
{{- include "workflow-role-base" . }}
|
||||
name: {{ template "argo-workflows.fullname" $ }}-workflow
|
||||
namespace: {{ $namespace }}
|
||||
{{- include "workflow-role-rules" . }}
|
||||
{{- end }}
|
||||
|
||||
{{- else }}
|
||||
|
||||
{{- range $namespace := append .Values.controller.workflowNamespaces .Values.workflow.namespace | compact | uniq }}
|
||||
{{ $namespace := . }}
|
||||
{{- include "workflow-role-base" . }}
|
||||
name: {{ template "argo-workflows.fullname" $ }}-workflow
|
||||
{{- if .Values.workflow.namespace }}
|
||||
namespace: {{ .Values.workflow.namespace }}
|
||||
{{- end }}
|
||||
namespace: {{ $namespace }}
|
||||
{{- include "workflow-role-rules" . }}
|
||||
{{- end }}
|
||||
|
||||
|
|
Loading…
Reference in a new issue