[bitnami/mongodb] Fix probes when url connection contains 'true' (#12133)

Signed-off-by: Benjamin Dupont <benjamin-dupont@harvest.fr>

Signed-off-by: Benjamin Dupont <benjamin-dupont@harvest.fr>
This commit is contained in:
bdupont-hvs
2022-08-26 19:39:31 +02:00
committed by GitHub
parent 82eb499b81
commit 39df1e709f
2 changed files with 4 additions and 4 deletions

View File

@@ -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

View File

@@ -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