Add debug info to wait-for-pods script

Change-Id: Id08669cfbcacb28eda0c96efc4f13b4b53542e22
This commit is contained in:
Vladimir Kozhukalov 2024-12-05 13:43:16 -06:00
parent 5b1bcd99ab
commit 44241611d8
2 changed files with 13 additions and 2 deletions

View File

@ -58,6 +58,18 @@ while true; do
fi
[ $READY == "False" ] && echo "Some pods are not ready"
[ $JOBR == "False" ] && echo "Some jobs have not succeeded"
echo
echo "=== DEBUG ==="
echo
echo "=== Running pods ready:"
kubectl get pods -n $1 -o json | jq -r '.items[]|select(.status.phase=="Running")| .metadata.namespace + ": " + .metadata.name + ": " + (.status.containerStatuses[].ready|tostring)'
echo "=== Jobs succeeded:"
kubectl get jobs -n $1 -o json | jq -r '.items[] | .metadata.namespace + ": " + .metadata.name + ": " + (.spec.completions == .status.succeeded | tostring)'
echo "=== PODS ==="
kubectl get pods -n $1 | tail -n +2 | awk '{print $1}' | while read pod; do kubectl describe pod $pod -n $1; echo; done
echo "=== JOBS ==="
kubectl get jobs -n $1 | tail -n +2 | awk '{print $1}' | while read job; do kubectl describe job $job -n $1; echo; done
exit -1
fi
done

View File

@ -15,8 +15,7 @@
check:
jobs:
- openstack-helm-plugin-lint
# Uncomment this once deployment jobs use the plugin
# - openstack-helm-plugin-compute-kit-metallb-2024-1-ubuntu_jammy # 1 node + 2 nodes
- openstack-helm-plugin-compute-kit-metallb-2024-1-ubuntu_jammy # 1 node + 2 nodes
gate:
jobs:
- openstack-helm-plugin-lint