{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ .Values.serviceAccount.name }}
  labels:
    app: {{ template "cpi.name" . }}
    vsphere-cpi-infra: service-account
    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
    component: cloud-controller-manager
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
  namespace: {{ .Release.Namespace }}
{{- end -}}
