{{- if .Values.enabled -}}
{{- if .Values.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
  labels:
    {{- include "weave-scope.helm_std_labels" . | indent 4 }}
    component: agent
  name: {{ template "weave-scope-agent.serviceAccountName" . }}
  annotations:
    {{- include "weave-scope.annotations" . | indent 4 }}
{{- end }}
{{- end -}}
