e2e: print K8s Pods and Events when kubectl wait fails

This commit is contained in:
Nils Hanke 2023-03-13 16:12:10 +01:00 committed by Nils Hanke
parent de86bb025f
commit 70ca69f6bc

View File

@ -215,12 +215,12 @@ runs:
exit 1
fi
echo "$(kubectl get nodes -o json | jq '.items | length')/"${NODES_COUNT}" nodes have joined"
kubectl wait --for=condition=ready --all nodes --timeout=20m
kubectlErrorCode=$?
if [[ "${kubectlErrorCode}" -ne 0 ]]; then
if ! kubectl wait --for=condition=ready --all nodes --timeout=20m; then
kubectl get pods -n kube-system
kubectl get events -n kube-system
exit "${kubectlErrorCode}"
echo "::error::kubectl wait timed out before all nodes became ready"
echo "::endgroup::"
exit 1
fi
echo "::endgroup::"