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 @@ -720,7 +720,7 @@ run_mongo() {
720
720
local suffix=${4:- .svc.cluster.local}
721
721
local client_container=$( kubectl_bin get pods --selector=name=psmdb-client -o ' jsonpath={.items[].metadata.name}' )
722
722
local mongo_flag=" $5 "
723
- local replica_set=$( echo " $uri " | sed -r ' s/.*\-(rs[0-9]|cfg)\. .*/\1/' )
723
+ local replica_set=$( echo " $uri " | sed -r ' s/.*\-(rs[0-9]|cfg)(\.|-) .*/\1/' )
724
724
725
725
kubectl_bin exec ${client_container} -- \
726
726
bash -c " printf '$command \n' | mongo $driver ://$uri$suffix /admin?ssl=false\&replicaSet=$replica_set $mongo_flag "
@@ -734,7 +734,7 @@ run_mongo_tls() {
734
734
local suffix=${4:- .svc.cluster.local}
735
735
local client_container=$( kubectl_bin get pods --selector=name=psmdb-client -o ' jsonpath={.items[].metadata.name}' )
736
736
local mongo_flag=" $5 "
737
- local replica_set=$( echo " $uri " | sed -r ' s/.*\-(rs[0-9]|cfg)\. .*/\1/' )
737
+ local replica_set=$( echo " $uri " | sed -r ' s/.*\-(rs[0-9]|cfg)(\.|-) .*/\1/' )
738
738
739
739
kubectl_bin exec ${client_container} -- \
740
740
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 "
@@ -1142,6 +1142,9 @@ kubectl_bin() {
1142
1142
cat " $LAST_OUT "
1143
1143
cat " $LAST_ERR " >&2
1144
1144
rm " $LAST_OUT " " $LAST_ERR "
1145
+ if [ ${exit_status} != 0 ]; then
1146
+ collect_k8s_logs
1147
+ fi
1145
1148
return ${exit_status}
1146
1149
}
1147
1150
You can’t perform that action at this time.
0 commit comments