{{- if not ( or .Values.databroker.storage.clientTLS.existingSecretName ( include "pomerium.redis.tlsCertsGenerated" .) ) -}}
apiVersion: v1
kind: Secret
metadata:
  name: {{ include "pomerium.databroker.storage.clientTLS.secret" . }}
  labels:
    app.kubernetes.io/name: {{ template "pomerium.name" . }}
    helm.sh/chart: {{ template "pomerium.chart" . }}
    app.kubernetes.io/managed-by: {{ .Release.Service }}
    app.kubernetes.io/instance: {{ .Release.Name }}
type: Opaque
data:
  tls.crt: {{ .Values.databroker.storage.clientTLS.cert | quote }}
  tls.key: {{ .Values.databroker.storage.clientTLS.key | quote }}
  ca.crt: {{ .Values.databroker.storage.clientTLS.ca | quote }}
{{- end -}}