File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -705,7 +705,7 @@ run_mongo() {
705
705
local suffix=${4:- .svc.cluster.local}
706
706
local client_container=$( kubectl_bin get pods --selector=name=psmdb-client -o ' jsonpath={.items[].metadata.name}' )
707
707
local mongo_flag=" $5 "
708
- local replica_set=$( echo " $uri " | sed -r ' s/.*\-(rs[0-9]|cfg)\. .*/\1/' )
708
+ local replica_set=$( echo " $uri " | sed -r ' s/.*\-(rs[0-9]|cfg)(\.|-) .*/\1/' )
709
709
710
710
kubectl_bin exec ${client_container} -- \
711
711
bash -c " printf '$command \n' | mongo $driver ://$uri$suffix /admin?ssl=false\&replicaSet=$replica_set $mongo_flag "
@@ -719,7 +719,7 @@ run_mongo_tls() {
719
719
local suffix=${4:- .svc.cluster.local}
720
720
local client_container=$( kubectl_bin get pods --selector=name=psmdb-client -o ' jsonpath={.items[].metadata.name}' )
721
721
local mongo_flag=" $5 "
722
- local replica_set=$( echo " $uri " | sed -r ' s/.*\-(rs[0-9]|cfg)\. .*/\1/' )
722
+ local replica_set=$( echo " $uri " | sed -r ' s/.*\-(rs[0-9]|cfg)(\.|-) .*/\1/' )
723
723
724
724
kubectl_bin exec ${client_container} -- \
725
725
bash -c " printf '$command \n' | mongo $driver ://$uri$suffix /admin?replicaSet=$replica_set --tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames $mongo_flag "
@@ -1119,6 +1119,9 @@ kubectl_bin() {
1119
1119
cat " $LAST_OUT "
1120
1120
cat " $LAST_ERR " >&2
1121
1121
rm " $LAST_OUT " " $LAST_ERR "
1122
+ if [ ${exit_status} != 0 ]; then
1123
+ collect_k8s_logs
1124
+ fi
1122
1125
return ${exit_status}
1123
1126
}
1124
1127
You can’t perform that action at this time.
0 commit comments