{{- if .Values.serviceAccount.create -}} apiVersion: v1 kind: ServiceAccount metadata: name: {{ include "ocrserver.serviceAccountName" . }} labels: {{- include "ocrserver.labels" . | nindent 4 }} annotations: "helm.sh/hook": pre-install "helm.sh/hook-weight": "5" "helm.sh/hook-delete-policy": hook-failed {{- with .Values.serviceAccount.annotations }} {{- toYaml . | nindent 4 }} {{- end }} automountServiceAccountToken: {{ .Values.serviceAccount.automount }} {{- end }}