{{- if and (not .Values.externalRedis.existingSecret) (not .Values.redis.existingSecret) }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ include "novu.redis.secretName" . }}
  namespace: {{ .Release.Namespace | quote }}
  labels: {{- include "common.labels.standard" . | nindent 4 }}
    {{- if .Values.commonLabels }}
    {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }}
    {{- end }}
    app.kubernetes.io/component: backend
  {{- if .Values.commonAnnotations }}
  annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }}
  {{- end }}
type: Opaque
data:
  redis-password: {{ include "common.secrets.passwords.manage" (dict "secret" (include "novu.redis.secretName" .) "key" "redis-password" "length" 10 "providedValues" (list "externalRedis.password" "redis.auth.password") "context" $) }}
{{- end }}
