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