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:
parent
77562cafb5
commit
3b4fd98b21
1 changed files with 3 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue