Skip to content

Commit

Permalink
fix mongodb secret condition and helper
Browse files Browse the repository at this point in the history
  • Loading branch information
filiprafaj committed May 9, 2024
1 parent b39b5c8 commit 6b2d3eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions docker/kubernetes/helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}

Expand Down
3 changes: 1 addition & 2 deletions docker/kubernetes/helm/templates/db-secrets.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
Expand Down

0 comments on commit 6b2d3eb

Please sign in to comment.