{{- if and .Values.operator.enabled .Values.serviceAccounts.operator.create }}
{{- if and .Values.eni.enabled .Values.eni.iamRole }}
  {{ $_ := set .Values.serviceAccounts.operator.annotations "eks.amazonaws.com/role-arn" .Values.eni.iamRole }}
{{- end}}
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ .Values.serviceAccounts.operator.name | quote }}
  namespace: {{ .Release.Namespace }}
  {{- if .Values.serviceAccounts.operator.annotations }}
  annotations:
    {{- toYaml .Values.serviceAccounts.operator.annotations | nindent 4 }}
  {{- end }}
{{- end }}
