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
ba262c923d
commit
1105f81d96
1 changed files with 5 additions and 15 deletions
|
@ -1,13 +1,12 @@
|
||||||
{{- define "workflow-role-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: Role
|
kind: Role
|
||||||
metadata:
|
metadata:
|
||||||
{{- end }}
|
name: {{ template "argo-workflows.fullname" $ }}-workflow
|
||||||
|
namespace: {{ $namespace }}
|
||||||
{{/* workflow-role-rules are defined separately so they can be inserted after templating the metadata */}}
|
|
||||||
|
|
||||||
{{- define "workflow-role-rules" }}
|
|
||||||
rules:
|
rules:
|
||||||
- apiGroups:
|
- apiGroups:
|
||||||
- ""
|
- ""
|
||||||
|
@ -24,15 +23,6 @@ rules:
|
||||||
verbs:
|
verbs:
|
||||||
- get
|
- get
|
||||||
- watch
|
- watch
|
||||||
{{- end }}
|
|
||||||
|
|
||||||
{{- if .Values.workflow.rbac.create -}}
|
|
||||||
|
|
||||||
{{- range $namespace := append .Values.controller.workflowNamespaces .Values.workflow.namespace | compact | uniq }}
|
|
||||||
{{- include "workflow-role-base" . }}
|
|
||||||
name: {{ template "argo-workflows.fullname" $ }}-workflow
|
|
||||||
namespace: {{ $namespace }}
|
|
||||||
{{- include "workflow-role-rules" . }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
Loading…
Reference in a new issue