{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ template "cni-metrics-helper.serviceAccountName" . }}
  namespace: {{ .Release.Namespace }}
{{- with .Values.serviceAccount.annotations }}
  annotations:
{{ toYaml . | indent 4 }}
{{- end }}
  labels:
{{ include "cni-metrics-helper.labels" . | indent 4 }}
{{- end -}}
