# grafana_charts_serviceaccount-compactor.yaml
{{ if and .Values.compactor.enabled .Values.compactor.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ include "loki.compactorServiceAccountName" . }}
  namespace: {{ .Release.Namespace }}
  labels:
    {{- include "loki.labels" . | nindent 4 }}
  {{- with .Values.compactor.serviceAccount.annotations }}
  annotations:
    {{- toYaml . | nindent 4 }}
  {{- end }}
automountServiceAccountToken: {{ .Values.compactor.serviceAccount.automountServiceAccountToken }}
{{- with .Values.compactor.serviceAccount.imagePullSecrets }}
imagePullSecrets:
  {{- toYaml . | nindent 2 }}
{{- end }}
{{- end }}