apiVersion: v1
kind: Secret
metadata:
  name: {{ include "api-platform.fullname" . }}
  labels:
    {{- include "api-platform.labels" . | nindent 4 }}
type: Opaque
data:
  {{- if .Values.postgresql.enabled }}
  database-url: {{ printf "pgsql://%s:%s@%s-postgresql/%s?serverVersion=16&charset=utf8" .Values.postgresql.global.postgresql.auth.username .Values.postgresql.global.postgresql.auth.password .Release.Name .Values.postgresql.global.postgresql.auth.database | b64enc | quote }}
  {{- else }}
  database-url: {{ .Values.postgresql.url | b64enc | quote }}
  {{- end }}
  php-app-secret: {{ .Values.php.appSecret | default (randAlphaNum 40) | b64enc | quote }}
  mercure-jwt-secret: {{ .Values.mercure.jwtSecret | default (randAlphaNum 40) | b64enc | quote }}
