{{- if and .Values.prometheusOperator.enabled .Values.prometheusOperator.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ template "prometheus-operator.operator.serviceAccountName" . }}
  namespace: {{ template "prometheus-operator.namespace" . }}
  labels:
    app: {{ template "prometheus-operator.name" . }}-operator
{{ include "prometheus-operator.labels" . | indent 4 }}
imagePullSecrets:
{{ toYaml .Values.global.imagePullSecrets | indent 2 }}
{{- end }}
