{{- if and .Values.serviceAccount.enabled .Values.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
metadata:
  name: "{{ .Values.serviceAccount.name | default (include "name" .) }}"
  namespace: {{ .Release.Namespace }}
  labels: {{ include "labels.standard" . | nindent 4 }}
  {{- with .Values.serviceAccount.annotations }}
  annotations:
    {{- toYaml . | nindent 4 }}
  {{- end }}
{{- end }}
