Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix mongodb secret condition and helper #5534

Merged
merged 1 commit into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading