{{- if and .Values.database.url (not .Values.database.existingSecret) }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ include "cleveragents.fullname" . }}-db
  labels:
    {{- include "cleveragents.labels" . | nindent 4 }}
type: Opaque
stringData:
  database-url: {{ .Values.database.url | quote }}
{{- end }}
{{- if and .Values.redis.enabled .Values.redis.auth.enabled .Values.redis.auth.password (not .Values.redis.auth.existingSecret) }}
---
apiVersion: v1
kind: Secret
metadata:
  name: {{ include "cleveragents.fullname" . }}-redis
  labels:
    {{- include "cleveragents.labels" . | nindent 4 }}
type: Opaque
stringData:
  redis-password: {{ .Values.redis.auth.password | quote }}
{{- end }}
