Skip to content

Commit 2678a91

Browse files
committed
Fix namespace in collect_k8s_logs function
1 parent c73a071 commit 2678a91

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

e2e-tests/functions

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,8 +1302,9 @@ collect_k8s_logs() {
13021302
if [[ ${ENABLE_LOG_COLLECT} == "true" ]]; then
13031303
local check_namespaces="${namespace}${OPERATOR_NS:+ $OPERATOR_NS}"
13041304
local logs_path="${logs_dir}/${test_name}"
1305+
13051306
rm -rf ${logs_path} || :
1306-
mkdir -p $logs_path
1307+
mkdir -p ${logs_path}
13071308

13081309
for ns in ${check_namespaces}; do
13091310
local pods=$(kubectl_bin get pods -n "${ns}" -o name | awk -F "/" '{print $2}')
@@ -1317,11 +1318,11 @@ collect_k8s_logs() {
13171318
done
13181319
done
13191320
for object in psmdb psmdb-backup psmdb-restore pods deployments services events sts; do
1320-
echo "##### START: ${ns}: ${object} #####" >>${logs_path}/_overview_${ns}.txt
1321-
kubectl_bin get ${object} -n "${ns}" >>${logs_path}/_overview_${ns}.txt || :
1322-
echo -e "##### END: ${ns}: ${object} ####\n" >>${logs_path}/_overview_${ns}.txt
1323-
kubectl_bin get ${object} -n "${ns}" -oyaml >${logs_path}/${object}_${ns}.yaml || :
1324-
kubectl_bin describe ${object} -n "${ns}" >${logs_path}/${object}_${ns}.dsc || :
1321+
echo "##### START: NS: ${namespace} - OBJ: ${object} #####" >>${logs_path}/_overview_${namespace}.txt
1322+
kubectl_bin get ${object} -n "${namespace}" >>${logs_path}/_overview_${namespace}.txt || :
1323+
echo -e "##### END: NS: ${namespace} - OBJ: ${object} ####\n" >>${logs_path}/_overview_${namespace}.txt
1324+
kubectl_bin get ${object} -n "${namespace}" -oyaml >${logs_path}/${object}_${namespace}.yaml || :
1325+
kubectl_bin describe ${object} -n "${namespace}" >${logs_path}/${object}_${namespace}.dsc || :
13251326
done
13261327
fi
13271328
}

e2e-tests/monitoring-2-0/run

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ if [[ -n ${OPENSHIFT} ]]; then
104104
fi
105105

106106
if [[ $(kubectl_bin logs monitoring-rs0-0 pmm-client | grep -c 'cannot auto discover databases and collections') != 0 ]]; then
107+
collect_k8s_logs
107108
echo "error: cannot auto discover databases and collections"
108109
exit 1
109110
fi

0 commit comments

Comments
 (0)