Skip to content

Commit feb20e2

Browse files
committed
prow.sh: collect cluster logs
We create at most two different clusters for each job, one with alpha features enabled and one without. For both the logs of system components are collected before tearing down the cluster and stored as artifacts under "cluster-logs/[non-]alpha". This is useful in particular for kubelet logs.
1 parent 51ac11c commit feb20e2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Diff for: prow.sh

+7-2
Original file line numberDiff line numberDiff line change
@@ -621,11 +621,16 @@ EOF
621621

622622
# Deletes kind cluster inside a prow job
623623
delete_cluster_inside_prow_job() {
624+
local name="$1"
625+
624626
# Inside a real Prow job it is better to clean up at runtime
625627
# instead of leaving that to the Prow job cleanup code
626628
# because the later sometimes times out (https://github.com/kubernetes-csi/csi-release-tools/issues/24#issuecomment-554765872).
629+
#
630+
# This is also a good time to collect logs.
627631
if [ "$JOB_NAME" ]; then
628632
if kind get clusters | grep -q csi-prow; then
633+
run kind export logs --name=csi-prow "${ARTIFACTS}/cluster-logs/$name"
629634
run kind delete cluster --name=csi-prow || die "kind delete failed"
630635
fi
631636
unset KUBECONFIG
@@ -1210,7 +1215,7 @@ main () {
12101215
fi
12111216
fi
12121217
fi
1213-
delete_cluster_inside_prow_job
1218+
delete_cluster_inside_prow_job non-alpha
12141219
fi
12151220
12161221
if tests_need_alpha_cluster && [ "${CSI_PROW_E2E_ALPHA_GATES}" ]; then
@@ -1245,7 +1250,7 @@ main () {
12451250
fi
12461251
fi
12471252
fi
1248-
delete_cluster_inside_prow_job
1253+
delete_cluster_inside_prow_job alpha
12491254
fi
12501255
fi
12511256

0 commit comments

Comments
 (0)