mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-15 06:34:03 +00:00
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:
parent
ceb5c69ee8
commit
8c9d08e872
@ -93,6 +93,9 @@ function run_tests() {
|
|||||||
kubectl -n kube-system wait --timeout=10m --for=condition=Ready -l name=kata-deploy pod
|
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"
|
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,
|
# 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
|
# which may cause issues like not having the node properly labeled or the artefacts
|
||||||
# properly deployed when the tests actually start running.
|
# 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 apply -f ${integration_dir}/kubernetes/runtimeclass_workloads/tests-namespace.yaml
|
||||||
kubectl config set-context --current --namespace=kata-containers-k8s-tests
|
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"
|
pushd "${integration_dir}/kubernetes"
|
||||||
bash setup.sh
|
bash setup.sh
|
||||||
bash run_kubernetes_tests.sh
|
bash run_kubernetes_tests.sh
|
||||||
@ -115,6 +121,9 @@ function run_tests() {
|
|||||||
function cleanup() {
|
function cleanup() {
|
||||||
platform="${1}"
|
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
|
# Switch back to the default namespace and delete the tests one
|
||||||
kubectl config set-context --current --namespace=default
|
kubectl config set-context --current --namespace=default
|
||||||
kubectl delete namespace kata-containers-k8s-tests
|
kubectl delete namespace kata-containers-k8s-tests
|
||||||
@ -148,6 +157,16 @@ function delete_cluster() {
|
|||||||
--yes
|
--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() {
|
function main() {
|
||||||
export KATA_HOST_OS="${KATA_HOST_OS:-}"
|
export KATA_HOST_OS="${KATA_HOST_OS:-}"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user