Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

print the phase+name of unhealthy pods in the kurl namespace #4866

Merged
merged 2 commits into from
Oct 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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