{{- if .Values.osccost.serviceAccount.enable }}
  {{ $root := . }}
  {{- with .Values.osccost.serviceAccount.enable }}
apiVersion: v1
kind: ServiceAccount
metadata:
  labels:
    helm.sh/chart: {{ $root.Chart.Name }}-{{ $root.Chart.Version }}
    app.kubernetes.io/name:  "{{ $root.Release.Name }}"
    app.kubernetes.io/managed-by: {{ $root.Release.Service }}
    app.kubernetes.io/instance: {{ template "osccost.fullname" $root }}
    app.kubernetes.io/part-of: {{ $root.Release.Name }}
  name: {{ template "osccost.serviceAccount" $root }}
  namespace: {{ $root.Release.Namespace }}
  {{- end }}
{{- end }}