From 82e523bfbdc837bf38720947da6eea70a3d19d3a Mon Sep 17 00:00:00 2001 From: Hakandede Date: Wed, 6 May 2026 11:10:35 +0000 Subject: [PATCH] add selector --- charts/countly-mongodb/templates/mongodbcommunity.yaml | 2 ++ charts/countly/templates/_helpers.tpl | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/charts/countly-mongodb/templates/mongodbcommunity.yaml b/charts/countly-mongodb/templates/mongodbcommunity.yaml index 6e2c250..d501afd 100644 --- a/charts/countly-mongodb/templates/mongodbcommunity.yaml +++ b/charts/countly-mongodb/templates/mongodbcommunity.yaml @@ -39,6 +39,8 @@ spec: {{- toYaml .Values.users.app.roles | nindent 8 }} scramCredentialsSecretName: {{ .Values.users.app.name }}-scram connectionStringSecretName: {{ include "countly-mongodb.fullname" . }}-{{ .Values.users.app.name }}-mongodb-conn + additionalConnectionStringConfig: + authSource: {{ .Values.users.app.database }} {{- if .Values.users.metrics.enabled }} - name: {{ .Values.users.metrics.name }} db: {{ .Values.users.metrics.database }} diff --git a/charts/countly/templates/_helpers.tpl b/charts/countly/templates/_helpers.tpl index 2045971..c861f99 100644 --- a/charts/countly/templates/_helpers.tpl +++ b/charts/countly/templates/_helpers.tpl @@ -148,7 +148,8 @@ Reads from backingServices.mongodb; constructs from service DNS if not provided. {{- $user := $bs.username | default "app" -}} {{- $db := $bs.database | default "admin" -}} {{- $rs := $bs.replicaSet | default (printf "%s-mongodb" .Release.Name) -}} -mongodb://{{ include "countly.mongodb.escapeUserInfo" $user }}:{{ include "countly.mongodb.escapeUserInfo" $pass }}@{{ $host }}:{{ $port }}/{{ $db }}?replicaSet={{ $rs }}&ssl=false +{{- $authDb := $bs.authDatabase | default "admin" -}} +mongodb://{{ include "countly.mongodb.escapeUserInfo" $user }}:{{ include "countly.mongodb.escapeUserInfo" $pass }}@{{ $host }}:{{ $port }}/{{ $db }}?replicaSet={{ $rs }}&ssl=false&authSource={{ $authDb }} {{- end -}} {{- end -}} @@ -172,7 +173,8 @@ Used by ExternalSecret templates where the password may come from the secret bac {{- $user := $bs.username | default "app" -}} {{- $db := $bs.database | default "admin" -}} {{- $rs := $bs.replicaSet | default (printf "%s-mongodb" $root.Release.Name) -}} -mongodb://{{ include "countly.mongodb.escapeUserInfo" $user }}:{{ $pass }}@{{ $host }}:{{ $port }}/{{ $db }}?replicaSet={{ $rs }}&ssl=false +{{- $authDb := $bs.authDatabase | default "admin" -}} +mongodb://{{ include "countly.mongodb.escapeUserInfo" $user }}:{{ $pass }}@{{ $host }}:{{ $port }}/{{ $db }}?replicaSet={{ $rs }}&ssl=false&authSource={{ $authDb }} {{- end -}} {{- end -}}