ci: k8s: Rework get_nodes_and_pods_info()

The amount of info we've added seemed unnecessary, and ends up making
our lives even harder when trying to find errors.

Let's just rely on the kata-debug container to collect the needed info
for us.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
Fabiano Fidêncio 2023-07-26 21:48:18 +02:00
parent 6ad5d7112e
commit 8353aae41a

View File

@ -130,7 +130,7 @@ function cleanup() {
ensure_yq
echo "Gather information about the nodes and pods before cleaning up the node"
get_nodes_and_pods_info "yes"
get_nodes_and_pods_info
if [ "${platform}" = "aks" ]; then
delete_cluster
@ -173,21 +173,6 @@ function delete_cluster() {
}
function get_nodes_and_pods_info() {
describe_pods="${1:-"no"}"
echo "::group::Get node information"
kubectl get nodes -o wide --show-labels=true
echo "::endgroup::"
echo ""
echo "::group::Get all the pods running"
kubectl get pods -A
echo "::endgroup::"
echo ""
if [[ "${describe_pods}" == "yes" ]]; then
echo "::group::Describe all the pods"
kubectl describe pods -A
echo "::endgroup::"
fi
kubectl debug $(kubectl get nodes -o name) -it --image=quay.io/kata-containers/kata-debug:latest
kubectl get pods -o name | grep node-debugger | xargs kubectl delete
}