{{- if and .Values.dashboard.serviceAccount.create .Values.dashboard.enabled }}
apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ template "dashboard.serviceAccountName" . }}
  namespace: {{ .Release.Namespace }}
  labels:
    app.kubernetes.io/name: {{ include "goldilocks.name" . }}
    helm.sh/chart: {{ include "goldilocks.chart" . }}
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/managed-by: {{ .Release.Service }}
    app.kubernetes.io/component: dashboard
{{- end }}
