Skip to content

Commit

Permalink
print the phase+name of unhealthy pods in the kurl namespace (#4866)
Browse files Browse the repository at this point in the history
* print the phase+name of unhealthy pods in the kurl namespace

* include all the information needed for us to debug this
  • Loading branch information
laverya authored Oct 9, 2023
1 parent e22b086 commit 78eb48f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/common/preflights.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ function bail_if_kurl_pods_are_unhealthy() {
log "Awaiting 2 minutes to check kURL Pod(s) are Running"
if ! spinner_until 120 check_for_running_pods kurl; then
kubectl get pods -n kurl

# for each pod in UNHEALTHY_PODS, print it and its current status
for pod in $UNHEALTHY_PODS; do
kubectl get pod -n kurl "$pod" -o jsonpath='pod {.metadata.name} owned by a {.metadata.ownerReferences[*].kind} has phase {.status.phase} with containers {range .status.containerStatuses[*]}{.name} ready={.ready} restarts={.restartCount};{end}'
done

bail "Kurl has unhealthy Pod(s) $UNHEALTHY_PODS. Restarting the pod may fix the issue."
fi
fi
Expand Down

0 comments on commit 78eb48f

Please sign in to comment.