{{- if and (not .Values.postgresql.enabled) (not .Values.orchard.database.existingSecret) }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ include "orchard.fullname" . }}-db-secret
  labels:
    {{- include "orchard.labels" . | nindent 4 }}
type: Opaque
data:
  password: {{ .Values.orchard.database.password | b64enc | quote }}
{{- end }}
---
{{- if and (not .Values.minio.enabled) (not .Values.orchard.s3.existingSecret) }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ include "orchard.fullname" . }}-s3-secret
  labels:
    {{- include "orchard.labels" . | nindent 4 }}
type: Opaque
data:
  access-key-id: {{ .Values.orchard.s3.accessKeyId | b64enc | quote }}
  secret-access-key: {{ .Values.orchard.s3.secretAccessKey | b64enc | quote }}
{{- end }}
