diff --git a/docker/kubernetes/helm/templates/_helpers.tpl b/docker/kubernetes/helm/templates/_helpers.tpl index 659d845e2ae..604c7b09b52 100644 --- a/docker/kubernetes/helm/templates/_helpers.tpl +++ b/docker/kubernetes/helm/templates/_helpers.tpl @@ -245,12 +245,12 @@ Return mongodb username Return mongodb secretName */}} {{- define "novu.mongodb.secretName" -}} -{{- if .Values.mongodb.enabled -}} +{{- if and (not .Values.externalDatabase.existingSecret) (not .Values.mongodb.auth.existingSecret) }} {{- printf "%s-url-mongodb" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" -}} {{- else if .Values.externalDatabase.existingSecret -}} {{- printf "%s" .Values.externalDatabase.existingSecret -}} -{{- else -}} - {{- printf "%s-externaldb" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" -}} +{{- else if .Values.mongodb.auth.existingSecret -}} + {{- printf "%s" .Values.mongodb.auth.existingSecret -}} {{- end -}} {{- end -}} diff --git a/docker/kubernetes/helm/templates/db-secrets.yaml b/docker/kubernetes/helm/templates/db-secrets.yaml index 4bcfb9095f6..9ba65d864eb 100644 --- a/docker/kubernetes/helm/templates/db-secrets.yaml +++ b/docker/kubernetes/helm/templates/db-secrets.yaml @@ -1,8 +1,7 @@ -{{- if and (not .Values.externalDatabase.existingSecret) (not .Values.mongodb.existingSecret) }} +{{- if and (not .Values.externalDatabase.existingSecret) (not .Values.mongodb.auth.existingSecret) }} apiVersion: v1 kind: Secret metadata: - name: {{ include "novu.mongodb.secretName" . }} namespace: {{ include "common.names.namespace" . | quote }} labels: {{- include "common.labels.standard" . | nindent 4 }}