From 39df1e709fea983e95c87876d8dd2af165cdfb1e Mon Sep 17 00:00:00 2001 From: bdupont-hvs <86662444+bdupont-hvs@users.noreply.github.com> Date: Fri, 26 Aug 2022 19:39:31 +0200 Subject: [PATCH] [bitnami/mongodb] Fix probes when url connection contains 'true' (#12133) Signed-off-by: Benjamin Dupont Signed-off-by: Benjamin Dupont --- bitnami/mongodb/Chart.yaml | 2 +- bitnami/mongodb/templates/common-scripts-cm.yaml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bitnami/mongodb/Chart.yaml b/bitnami/mongodb/Chart.yaml index ff7c68be80..08b96fd3c7 100644 --- a/bitnami/mongodb/Chart.yaml +++ b/bitnami/mongodb/Chart.yaml @@ -26,4 +26,4 @@ name: mongodb sources: - https://github.com/bitnami/containers/tree/main/bitnami/mongodb - https://mongodb.org -version: 13.1.1 +version: 13.1.2 diff --git a/bitnami/mongodb/templates/common-scripts-cm.yaml b/bitnami/mongodb/templates/common-scripts-cm.yaml index 5e072b92db..49e849d52d 100644 --- a/bitnami/mongodb/templates/common-scripts-cm.yaml +++ b/bitnami/mongodb/templates/common-scripts-cm.yaml @@ -17,7 +17,7 @@ data: {{- if .Values.tls.enabled }} TLS_OPTIONS='--tls --tlsCertificateKeyFile=/certs/mongodb.pem --tlsCAFile=/certs/mongodb-ca-cert' {{- end }} - mongosh $TLS_OPTIONS --port $MONGODB_PORT_NUMBER --eval 'db.hello().isWritablePrimary || db.hello().secondary' | grep -q 'true' + mongosh $TLS_OPTIONS --port $MONGODB_PORT_NUMBER --eval 'db.hello().isWritablePrimary || db.hello().secondary' | grep -q 'true$' readiness-probe.sh: | #!/bin/bash {{- if .Values.tls.enabled }} @@ -30,9 +30,9 @@ data: VERSION_MINOR="$(get_sematic_version "$VERSION" 2)" VERSION_PATCH="$(get_sematic_version "$VERSION" 3)" if [[ ( "$VERSION_MAJOR" -ge 5 ) || ( "$VERSION_MAJOR" -ge 4 && "$VERSION_MINOR" -ge 4 && "$VERSION_PATCH" -ge 2 ) ]]; then - mongosh $TLS_OPTIONS --port $MONGODB_PORT_NUMBER --eval 'db.hello().isWritablePrimary || db.hello().secondary' | grep -q 'true' + mongosh $TLS_OPTIONS --port $MONGODB_PORT_NUMBER --eval 'db.hello().isWritablePrimary || db.hello().secondary' | grep -q 'true$' else - mongosh $TLS_OPTIONS --port $MONGODB_PORT_NUMBER --eval 'db.isMaster().ismaster || db.isMaster().secondary' | grep -q 'true' + mongosh $TLS_OPTIONS --port $MONGODB_PORT_NUMBER --eval 'db.isMaster().ismaster || db.isMaster().secondary' | grep -q 'true$' fi ping-mongodb.sh: | #!/bin/bash