{{- if and .Values.compactor.enabled (not (include "thanos.serviceaccount.use-existing" (dict "component" "compactor" "context" $))) -}}
apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ include "thanos.serviceaccount.name" (dict "component" "compactor" "context" $) }}
  labels: {{- include "thanos.labels" . | nindent 4 }}
    app.kubernetes.io/component: compactor
  {{- if .Values.compactor.serviceAccount.annotations }}
  annotations:
    {{- include "thanos.tplValue" ( dict "value" .Values.compactor.serviceAccount.annotations "context" $) | nindent 4 }}
  {{- end }}
{{- end }}
