inline "define" templates with simple values now that controller.workflowNamespaces and workflow.namespace are unified into a single "range" iteration
Signed-off-by: reinvantveer <rein.van.t.veer@geodan.nl>
This commit is contained in:
parent
1105f81d96
commit
5bcdab7c22
1 changed files with 5 additions and 21 deletions
|
@ -1,34 +1,18 @@
|
||||||
{{- define "workflow-rb-base" }}
|
{{- if .Values.workflow.rbac.create -}}
|
||||||
|
{{- range $namespace := append .Values.controller.workflowNamespaces .Values.workflow.namespace | compact | uniq }}
|
||||||
---
|
---
|
||||||
apiVersion: rbac.authorization.k8s.io/v1
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
kind: RoleBinding
|
kind: RoleBinding
|
||||||
metadata:
|
metadata:
|
||||||
{{- end }}
|
name: {{ template "argo-workflows.fullname" }}-workflow
|
||||||
|
namespace: {{ $namespace }}
|
||||||
{{- define "workflow-rb-roleref" }}
|
|
||||||
roleRef:
|
roleRef:
|
||||||
apiGroup: rbac.authorization.k8s.io
|
apiGroup: rbac.authorization.k8s.io
|
||||||
kind: Role
|
kind: Role
|
||||||
{{- end }}
|
name: {{ template "argo-workflows.fullname" $ }}-workflow
|
||||||
|
|
||||||
{{- define "workflow-rb-subjects" }}
|
|
||||||
subjects:
|
subjects:
|
||||||
- kind: ServiceAccount
|
- kind: ServiceAccount
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
{{- if .Values.workflow.rbac.create -}}
|
|
||||||
{{- range $namespace := append .Values.controller.workflowNamespaces .Values.workflow.namespace | compact | uniq }}
|
|
||||||
|
|
||||||
{{ include "workflow-rb-base" . }}
|
|
||||||
name: {{ template "argo-workflows.fullname" }}-workflow
|
|
||||||
namespace: {{ $namespace }}
|
|
||||||
|
|
||||||
{{- include "workflow-rb-roleref" . }}
|
|
||||||
name: {{ template "argo-workflows.fullname" $ }}-workflow
|
|
||||||
|
|
||||||
{{- include "workflow-rb-subjects" . }}
|
|
||||||
name: {{ $.Values.workflow.serviceAccount.name }}
|
name: {{ $.Values.workflow.serviceAccount.name }}
|
||||||
namespace: {{ $namespace }}
|
namespace: {{ $namespace }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
Loading…
Reference in a new issue