File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -63,11 +63,20 @@ jobs:
6363 echo "No clusters to delete."
6464 exit 0
6565 fi
66-
66+
6767 for cluster_prefix in ${ci_clusters}
6868 do
6969 echo "Processing cluster: $cluster_prefix"
70- TAGS=$(openstack server show ${cluster_prefix}-control --column tags --format value)
70+ # Get all servers with the matching name for control node
71+ CONTROL_SERVERS=$(openstack server list --name ${cluster_prefix}-control --format json)
72+ SERVER_COUNT=$(echo "$CONTROL_SERVERS" | jq length)
73+
74+ if [[ $SERVER_COUNT -gt 1 ]]; then
75+ echo "Warning: More than one server found for control node '${cluster_prefix}-control'."
76+ continue
77+ fi
78+ TAGS=$(echo "$CONTROL_SERVERS" | jq -r '.[0].Tags' )
79+
7180 if [[ $TAGS =~ "keep" ]]; then
7281 echo "Skipping ${cluster_prefix} - control instance is tagged as keep"
7382 else
You can’t perform that action at this time.
0 commit comments