gha: ci: Gather info about the node / pods

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 <fabiano.fidencio@intel.com>
This commit is contained in:
Fabiano Fidêncio 2023-07-10 09:23:13 +02:00
parent ceb5c69ee8
commit 8c9d08e872

View File

@ -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:-}"