{{- if .Values.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ include "autoneg.serviceAccountName" . | quote }}
  namespace: {{ include "autoneg.namespace" . | quote }}
  labels: {{- include "autoneg.labels" . | nindent 4 }}
    app.kubernetes.io/component: controller
  {{- $annotations := merge .Values.annotations .Values.serviceAccount.annotations -}}
  {{- with $annotations }}
  annotations:
    {{- toYaml . | nindent 4 }}
  {{- end }}
automountServiceAccountToken: {{ default false .Values.serviceAccount.automountServiceAccountToken }}
{{- end -}}