From 3b4fd98b21339a9c97ad3cf688d03d4d2a3c9c31 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Sat, 17 Jan 2026 17:23:36 -0600 Subject: [PATCH] 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 --- k8s/debug-redis.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/k8s/debug-redis.sh b/k8s/debug-redis.sh index b625fb6b..1fa5886f 100755 --- a/k8s/debug-redis.sh +++ b/k8s/debug-redis.sh @@ -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