{{- if and (not $.Values.crds.exclusive) $.Values.global.jobs.preDelete.enabled }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ include "capsule.pre-delete.name" . }}
  namespace: {{ $.Release.Namespace }}
  annotations:
    "helm.sh/hook-weight": "-4"
    {{- include "capsule.pre-delete.annotations" . | nindent 4 }}
  labels:
    app.kubernetes.io/component: {{ include "capsule.pre-delete.component" . | quote }}
    app.kubernetes.io/name: {{ include "capsule.pre-delete.component" . | quote }}
    {{- include "capsule.baselabels" . | nindent 4 }}
    {{- include "capsule.selectorLabelInstance" . | nindent 4 }}
{{- end }}
