Skip to content

Commit 4989b7b

Browse files
committed
debug: add verbose output to hook-pod-logs to diagnose CI failure
1 parent 594b6c2 commit 4989b7b

2 files changed

Lines changed: 24 additions & 2 deletions

File tree

website/docs/fastpaths/developer/amazon-eks-pod-identity/tests/hook-pod-logs.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,15 @@ before() {
55
}
66

77
after() {
8+
echo "=== DEBUG: Checking carts pods ==="
9+
kubectl get pods -n carts -l app.kubernetes.io/component=service -o wide 2>&1 || true
10+
echo "=== DEBUG: Carts configmap ==="
11+
kubectl -n carts get cm carts -o jsonpath='{.data}' 2>&1 || true
12+
echo ""
13+
echo "=== DEBUG: Pod identity associations ==="
14+
aws eks list-pod-identity-associations --cluster-name ${EKS_CLUSTER_AUTO_NAME} --namespace carts 2>&1 || true
15+
816
# Wait for the carts pod to crash and restart at least once
9-
# then check previous container logs for the expected credential error
1017
echo "Waiting for carts pod to crash and restart..."
1118

1219
for i in $(seq 1 36); do
@@ -23,6 +30,10 @@ after() {
2330
sleep 10
2431
done
2532

33+
echo "=== DEBUG: Final pod state ==="
34+
kubectl get pods -n carts -l app.kubernetes.io/component=service -o wide 2>&1 || true
35+
kubectl describe pods -n carts -l app.kubernetes.io/component=service 2>&1 | tail -30 || true
36+
2637
echo "Failed to find expected credential error after 360s"
2738
exit 1
2839
}

website/docs/fastpaths/operator/amazon-eks-pod-identity/tests/hook-pod-logs.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,15 @@ before() {
55
}
66

77
after() {
8+
echo "=== DEBUG: Checking carts pods ==="
9+
kubectl get pods -n carts -l app.kubernetes.io/component=service -o wide 2>&1 || true
10+
echo "=== DEBUG: Carts configmap ==="
11+
kubectl -n carts get cm carts -o jsonpath='{.data}' 2>&1 || true
12+
echo ""
13+
echo "=== DEBUG: Pod identity associations ==="
14+
aws eks list-pod-identity-associations --cluster-name ${EKS_CLUSTER_AUTO_NAME} --namespace carts 2>&1 || true
15+
816
# Wait for the carts pod to crash and restart at least once
9-
# then check previous container logs for the expected credential error
1017
echo "Waiting for carts pod to crash and restart..."
1118

1219
for i in $(seq 1 36); do
@@ -23,6 +30,10 @@ after() {
2330
sleep 10
2431
done
2532

33+
echo "=== DEBUG: Final pod state ==="
34+
kubectl get pods -n carts -l app.kubernetes.io/component=service -o wide 2>&1 || true
35+
kubectl describe pods -n carts -l app.kubernetes.io/component=service 2>&1 | tail -30 || true
36+
2637
echo "Failed to find expected credential error after 360s"
2738
exit 1
2839
}

0 commit comments

Comments
 (0)