apiVersion: v1
kind: ServiceAccount
metadata:
{{- if or .Values.serviceAccountAnnotations .Values.gke.workloadIdentityEmail }}
  annotations:
  {{- with .Values.serviceAccountAnnotations}}
  {{ toYaml . | trim | indent 2}}
  {{- end }}
  {{- if ne .Values.gke.workloadIdentityEmail "" }}
    iam.gke.io/gcp-service-account: {{ .Values.gke.workloadIdentityEmail }}
  {{- end }}
{{- end }}
  labels:
    app: fleet
    chart: fleet
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
  name: fleet
  namespace: {{ .Release.Namespace }}
