---
{{- if not .Values.secrets.existingSecret }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ include "oxicloud.fullname" . }}-secret
  labels:
    {{- include "oxicloud.labels" . | nindent 4 }}
type: Opaque
data:
  {{- if .Values.secrets.jwtSecret }}
  OXICLOUD_JWT_SECRET: {{ .Values.secrets.jwtSecret | b64enc | quote }}
  {{- end }}
  {{- if .Values.postgresql.enabled }}
  DB_PASSWORD: {{ .Values.postgresql.auth.password | b64enc | quote }}
  {{- end }}
  {{- if .Values.wopi.enabled }}
  WOPI_ADMIN_USERNAME: {{ .Values.wopi.collabora.admin.username | b64enc | quote }}
  WOPI_ADMIN_PASSWORD: {{ .Values.wopi.collabora.admin.password | b64enc | quote }}
  {{- end }}
{{- end }}