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:
63
63
echo "No clusters to delete."
64
64
exit 0
65
65
fi
66
-
66
+
67
67
for cluster_prefix in ${ci_clusters}
68
68
do
69
69
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
+
71
80
if [[ $TAGS =~ "keep" ]]; then
72
81
echo "Skipping ${cluster_prefix} - control instance is tagged as keep"
73
82
else
You can’t perform that action at this time.
0 commit comments