include case for single namespaces with default ("") namespace, otherwise (ternary) combine the workflow namespace and workflowNamespaces from the controller settings into a list to iterate over

Signed-off-by: reinvantveer <reinvantveer@gmail.com>
This commit is contained in:
reinvantveer 2021-07-14 19:00:24 +02:00
parent bfd9eaa013
commit 094cd02860
3 changed files with 3 additions and 4 deletions

View file

@ -1,5 +1,5 @@
{{- if .Values.workflow.rbac.create -}}
{{- range $namespace := append .Values.controller.workflowNamespaces .Values.workflow.namespace | compact | uniq }}
{{- range $namespace := .Values.singeNamespace | ternary (list "") (concat .Values.workflow.namespace .Values.controller.workflowNamespaces | compact | uniq) }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding

View file

@ -1,6 +1,5 @@
{{- if .Values.workflow.rbac.create -}}
{{- range $namespace := append .Values.controller.workflowNamespaces .Values.workflow.namespace | compact | uniq }}
{{- range $namespace := .Values.singeNamespace | ternary (list "") (concat .Values.workflow.namespace .Values.controller.workflowNamespaces | compact | uniq) }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role

View file

@ -1,5 +1,5 @@
{{- if .Values.workflow.serviceAccount.create -}}
{{ range $namespace := append .Values.controller.workflowNamespaces .Values.workflow.namespace | compact | uniq }}
{{ range $namespace := .Values.singeNamespace | ternary (list "") (concat .Values.workflow.namespace .Values.controller.workflowNamespaces | compact | uniq) }}
---
apiVersion: v1
kind: ServiceAccount