Print the deployment status during timeout in csit 36/138636/1
authorrameshiyer27 <ramesh.murugan.iyer@est.tech>
Tue, 6 Aug 2024 10:10:19 +0000 (11:10 +0100)
committerrameshiyer27 <ramesh.murugan.iyer@est.tech>
Tue, 6 Aug 2024 10:10:19 +0000 (11:10 +0100)
Issue-ID: POLICY-4647
Change-Id: Ib16cc7965490bfa4b2312355ac41e93f149ec8c7
Signed-off-by: zrrmmua <ramesh.murugan.iyer@est.tech>
csit/run-k8s-csit.sh

index 6502c34..d8ce6f9 100755 (executable)
@@ -366,7 +366,15 @@ wait_for_pods_running() {
     elapsed_time=$((current_time - start_time))
 
     if [ "$elapsed_time" -ge "$timeout_seconds" ]; then
-      echo "Timed out waiting for all pods to reach 'Running' state."
+      echo "Timed out waiting for the pods to reach 'Running' state."
+      echo "Printing the current status of the deployment before exiting.."
+      kubectl describe pods;
+      echo "------------------------------------------------------------"
+      for pod in "${pending_pods[@]}"; do
+        echo "Logs of the pod $pod"
+        kubectl logs $pod
+        echo "---------------------------------------------------------"
+      done
       exit 1
     fi