From 8c9d08e87211f40001907e5365175a83c7e65c7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Mon, 10 Jul 2023 09:23:13 +0200 Subject: [PATCH] gha: ci: Gather info about the node / pods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a very simple addition, that should be expanded by https://github.com/kata-containers/kata-containers/pull/7185, and it's targetting gathering more info that will help us to debug CI failures. Fixes: #7296 Signed-off-by: Fabiano FidĂȘncio --- tests/integration/gha-run.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/integration/gha-run.sh b/tests/integration/gha-run.sh index 46225bd175..102348caec 100755 --- a/tests/integration/gha-run.sh +++ b/tests/integration/gha-run.sh @@ -93,6 +93,9 @@ function run_tests() { kubectl -n kube-system wait --timeout=10m --for=condition=Ready -l name=kata-deploy pod kubectl apply -f "${tools_dir}/packaging/kata-deploy/runtimeclasses/kata-runtimeClasses.yaml" + echo "Gather information about the nodes and pods after having kata-deploy ready" + get_nodes_and_pods_info + # This is needed as the kata-deploy pod will be set to "Ready" when it starts running, # which may cause issues like not having the node properly labeled or the artefacts # properly deployed when the tests actually start running. @@ -106,6 +109,9 @@ function run_tests() { kubectl apply -f ${integration_dir}/kubernetes/runtimeclass_workloads/tests-namespace.yaml kubectl config set-context --current --namespace=kata-containers-k8s-tests + echo "Gather information about the nodes and pods just before starting the tests" + get_nodes_and_pods_info + pushd "${integration_dir}/kubernetes" bash setup.sh bash run_kubernetes_tests.sh @@ -115,6 +121,9 @@ function run_tests() { function cleanup() { platform="${1}" + echo "Gather information about the nodes and pods before cleaning up the node" + get_nodes_and_pods_info "yes" + # Switch back to the default namespace and delete the tests one kubectl config set-context --current --namespace=default kubectl delete namespace kata-containers-k8s-tests @@ -148,6 +157,16 @@ function delete_cluster() { --yes } +function get_nodes_and_pods_info() { + describe_pods="${1:-"no"}" + + kubectl get nodes -o wide --show-labels=true + kubectl get pods -A + if [[ "${describe_pods}" == "yes" ]]; then + kubectl describe pods -A + fi +} + function main() { export KATA_HOST_OS="${KATA_HOST_OS:-}"