Update debug script to select only running pods

Changed pod selection to use --field-selector=status.phase=Running
to avoid selecting Terminating pods during rollout
This commit is contained in:
Graham McIntire 2026-01-17 17:23:36 -06:00
parent 77562cafb5
commit 3b4fd98b21
No known key found for this signature in database

View file

@ -4,10 +4,11 @@
set -e
NAMESPACE="${1:-towerops}"
POD_NAME=$(kubectl get pods -n "$NAMESPACE" -l app=towerops -o jsonpath='{.items[0].metadata.name}' 2>/dev/null)
# Get a running pod (not terminating)
POD_NAME=$(kubectl get pods -n "$NAMESPACE" -l app=towerops --field-selector=status.phase=Running -o jsonpath='{.items[0].metadata.name}' 2>/dev/null)
if [ -z "$POD_NAME" ]; then
echo "Error: No towerops pods found in namespace $NAMESPACE"
echo "Error: No running towerops pods found in namespace $NAMESPACE"
exit 1
fi