[mongodb-replicaset] replace MONGODB_URL with --mongodb.uri (#10026)

* replace MONGODB_URL with --mongodb.uri; minor test fixes

Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@commercetools.de>

* remove admin database for auth

Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@commercetools.de>

* replace MONGODB_URL to -mongodb.uri in livenessProbe

Signed-off-by: Tetiana Kravchenko <tetiana.kravchenko@commercetools.de>
This commit is contained in:
tetianakravchenko
2018-12-15 09:08:28 -08:00
committed by Kubernetes Prow Robot
parent 2584adbdab
commit 04ac9216fa
3 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
name: mongodb-replicaset
home: https://github.com/mongodb/mongo
version: 3.8.5
version: 3.8.6
appVersion: 3.6
description: NoSQL document-oriented database that stores JSON-like documents with
dynamic schemas, simplifying the integration of data in content-driven applications.
@@ -229,12 +229,12 @@ spec:
- sh
- -ec
- >-
{{- if .Values.auth.enabled }}
export MONGODB_URL=mongodb://$METRICS_USER:$METRICS_PASSWORD@localhost:{{ .Values.port }};
{{- else }}
export MONGODB_URL=mongodb://localhost:{{ .Values.port }};
{{- end }}
/bin/mongodb_exporter
{{- if .Values.auth.enabled }}
-mongodb.uri mongodb://$METRICS_USER:$METRICS_PASSWORD@localhost:{{ .Values.port }}
{{- else }}
-mongodb.uri mongodb://localhost:{{ .Values.port }}
{{- end }}
{{- if .Values.tls.enabled }}
-mongodb.tls
-mongodb.tls-ca=/ca/tls.crt
@@ -277,12 +277,12 @@ spec:
- sh
- -ec
- >-
{{- if .Values.auth.enabled }}
export MONGODB_URL=mongodb://$METRICS_USER:$METRICS_PASSWORD@localhost:{{ .Values.port }};
{{- else }}
export MONGODB_URL=mongodb://localhost:{{ .Values.port }};
{{- end }}
/bin/mongodb_exporter
{{- if .Values.auth.enabled }}
-mongodb.uri mongodb://$METRICS_USER:$METRICS_PASSWORD@localhost:{{ .Values.port }}
{{- else }}
-mongodb.uri mongodb://localhost:{{ .Values.port }}
{{- end }}
{{- if .Values.tls.enabled }}
-mongodb.tls
-mongodb.tls-ca=/ca/tls.crt
@@ -26,7 +26,7 @@ replicas() {
master_pod() {
for ((i = 0; i < $(replicas); ++i)); do
response=$(mongo $MONGOARGS "--host=$(pod_name "$i")" "--eval=rs.isMaster().ismaster")
if [[ "$response" =~ "true" ]]; then
if [[ "$response" == "true" ]]; then
pod_name "$i"
break
fi
@@ -64,7 +64,7 @@ setup() {
@test "Write key to primary" {
response=$(mongo $MONGOARGS --host=$(master_pod) "--eval=db.test.insert({\"abc\": \"def\"}).nInserted")
if [[ ! "$response" =~ "1" ]]; then
if [[ ! "$response" -eq 1 ]]; then
exit 1
fi
}