{{- if and .Values.api.enabled .Values.api.oidc.enabled .Values.api.oidc.dex.enabled .Values.api.oidc.dex.tls.selfSignedCert }}
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: kargo-dex-server
  namespace: {{ .Release.Namespace }}
spec:
  dnsNames:
  - kargo-dex-server.{{ .Release.Namespace }}.svc
  issuerRef:
    kind: Issuer
    name: kargo-selfsigned-cert-issuer
  secretName: kargo-dex-server-cert
{{- end }}
