@@ -13,18 +13,22 @@ echo "Using the ${KUBECTL} kubectl binary"
13
13
echo " Using the ${TEST_ARTIFACTS_DIR} output directory"
14
14
mkdir -p " ${TEST_ARTIFACTS_DIR} "
15
15
16
+ OLM_RESOURCES=" csv,sub,catsrc,installplan"
17
+
16
18
commands=()
17
- commands+=(" get catalogsources -o yaml" )
18
- commands+=(" get subscriptions -o yaml" )
19
- commands+=(" get operatorgroups -o yaml" )
20
- commands+=(" get clusterserviceversions -o yaml" )
21
- commands+=(" get installplans -o yaml" )
22
- commands+=(" get pods -o wide" )
19
+ commands+=(" describe all,${OLM_RESOURCES} " )
20
+ commands+=(" get all,${OLM_RESOURCES} -o yaml" )
21
+ commands+=(" get all,${OLM_RESOURCES} -o wide" )
23
22
commands+=(" get events --sort-by .lastTimestamp" )
24
23
25
24
echo " Storing the test artifact output in the ${TEST_ARTIFACTS_DIR} directory"
26
25
for command in " ${commands[@]} " ; do
27
26
echo " Collecting ${command} output..."
28
27
COMMAND_OUTPUT_FILE=${TEST_ARTIFACTS_DIR} /${command// / _}
29
- ${KUBECTL} -n ${TEST_NAMESPACE} ${command} >> " ${COMMAND_OUTPUT_FILE} "
28
+ ${KUBECTL} -n " ${TEST_NAMESPACE} " " ${command} " >> " ${COMMAND_OUTPUT_FILE} "
29
+ done
30
+
31
+ for pod in $( ${KUBECTL} -n " ${TEST_NAMESPACE} " get --no-headers pods | awk ' { print $1 }' ) ; do
32
+ echo " Collecting logs for pod: ${pod} "
33
+ ${KUBECTL} -n " ${TEST_NAMESPACE} " logs " ${pod} " >> " ${TEST_ARTIFACTS_DIR} /${pod} .log"
30
34
done
0 commit comments