{{- if and .Values.istio.install (not .Release.IsInstall) -}}
{{ if .Values.auth.enabled }}
{{- $serviceName := include "istio.name" . -}}
apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ $serviceName }}-{{ .Values.ca.deployment.name }}-service-account
  labels:
{{ include "istio.labels.standard" . | indent 4 }}
    istio: {{ $serviceName }}-{{ .Values.ca.deployment.name }}
{{ end }}
{{- end -}}
