feat: allow arguments to be passed to templates
This commit is contained in:
@ -1,8 +1,10 @@
|
||||
{{/* vim: set filetype=mustache: */}}
|
||||
|
||||
{{- define "common.serviceAccount.metadata" -}}
|
||||
name: {{ include "common.serviceAccountName" . }}
|
||||
{{- with .Values.serviceAccount.annotations }}
|
||||
{{- $top := first . -}}
|
||||
{{- $serviceAccount := index . 1 -}}
|
||||
name: {{ include "common.serviceAccountName" $top }}
|
||||
{{- with $serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 2 }}
|
||||
{{- end }}
|
||||
@ -12,17 +14,13 @@ annotations:
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
{{ include "common.metadata" (list . "common.serviceAccount.metadata") | nindent 2 }}
|
||||
{{ include "common.metadata" (append . "common.serviceAccount.metadata") | nindent 2 }}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "common.serviceAccount.if" -}}
|
||||
{{- define "common.serviceAccount" -}}
|
||||
{{- $top := first . -}}
|
||||
{{- $serviceAccount := $top.Values.serviceAccount | default (dict) -}}
|
||||
{{- $serviceAccount := index . 1 -}}
|
||||
{{- if $serviceAccount.create -}}
|
||||
{{- include "common.utils.merge" (append . "common.serviceAccount.tpl") -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "common.serviceAccount" -}}
|
||||
{{- include "common.utils.flattenCall" (list "common.serviceAccount.if" .) -}}
|
||||
{{- end -}}
|
||||
|
Reference in New Issue
Block a user