helm-charts/charts/library/common/templates/render/_serviceaccount.tpl
Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs 0a5fb9d3d4
fix: Fix SA Secret annotation
2022-11-19 14:58:19 +01:00

13 lines
599 B
Smarty

{{/*
Renders the serviceAccount object required by the chart.
*/}}
{{- define "bjw-s.common.render.serviceAccount" -}}
{{- if .Values.serviceAccount.create -}}
{{- /* Create a service account secret */ -}}
{{- $serviceAccountName := include "bjw-s.common.lib.chart.names.serviceAccountName" . -}}
{{- $_ := set .Values.secrets "sa-token" (dict "enabled" true "annotations" (dict "kubernetes.io/service-account.name" $serviceAccountName) "type" "kubernetes.io/service-account-token") -}}
{{- include "bjw-s.common.class.serviceAccount" $ | nindent 0 -}}
{{- end -}}
{{- end -}}