{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ template "local-path-provisioner.serviceAccountName" . }}
  namespace: {{ include "local-path-provisioner.namespace" . }}
  labels:
{{ include "local-path-provisioner.labels" . | indent 4 }}
imagePullSecrets:
{{- with .Values.imagePullSecrets }}
  {{- toYaml . | nindent 2 }}
{{- end }}
{{- if .Values.defaultSettings.registrySecret }}
  - name: {{ .Values.defaultSettings.registrySecret }}
{{- end }}
{{- end }}
