{{- if and .Values.serviceAccount.create .Values.deployments.etcdOperator }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ template "etcd-operator.serviceAccountName" . }}
  labels:
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    app: {{ template "etcd-operator.name" . }}
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
imagePullSecrets: {{ toYaml .Values.global.imagePullSecrets | nindent 2 }}
{{- end }}
