{{- if and .Values.collector.enabled .Values.collector.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ template "jaeger.collector.serviceAccountName" . }}
  labels:
    {{- include "jaeger.labels" . | nindent 4 }}
    app.kubernetes.io/component: collector
  {{- with .Values.collector.serviceAccount.annotations }}
  annotations:
    {{- toYaml . | nindent 4 }}
  {{- end }}
automountServiceAccountToken: {{ .Values.collector.serviceAccount.automountServiceAccountToken }}
{{- end -}}
