{{/* vim: set filetype=mustache: */}} {{- define "common.serviceAccount.metadata" -}} name: {{ include "common.serviceAccountName" . }} {{- with .Values.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 2 }} {{- end }} {{- end -}} {{- define "common.serviceAccount.tpl" -}} apiVersion: v1 kind: ServiceAccount metadata: {{ include "common.metadata" (list . "common.serviceAccount.metadata") | nindent 2 }} {{- end -}} {{- define "common.serviceAccount.if" -}} {{- $top := first . -}} {{- $serviceAccount := $top.Values.serviceAccount | default (dict) -}} {{- 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 -}}