File tree Expand file tree Collapse file tree 1 file changed +4
-28
lines changed Expand file tree Collapse file tree 1 file changed +4
-28
lines changed Original file line number Diff line number Diff line change @@ -56,37 +56,13 @@ jobs:
5656 fi
5757 shell : bash
5858
59- - name : Delete clusters
59+ - name : Delete CI clusters
6060 run : |
6161 . venv/bin/activate
62- if [[ -z ${ci_clusters} ]]; then
62+ if [[ -z " ${ci_clusters}" ]]; then
6363 echo "No clusters to delete."
6464 exit 0
6565 fi
66-
67- for cluster_prefix in ${ci_clusters}
68- do
69- echo "Processing cluster: $cluster_prefix"
70-
71- # Get all servers with the matching name for control node
72- CONTROL_SERVERS=$(openstack server list --name ${cluster_prefix}-control --format json)
73-
74- # Get unique server names to avoid duplicate cleanup
75- UNIQUE_NAMES=$(echo "$CONTROL_SERVERS" | jq -r '.[].Name' | sort | uniq)
76- for name in $UNIQUE_NAMES; do
77- echo "Deleting cluster with control node: $name"
78-
79- # Get the first matching server ID by name
80- server=$(echo "$CONTROL_SERVERS" | jq -r '.[] | select(.Name=="'"$name"'") | .ID' | head -n1)
81-
82- # Make sure server still exists (wasn't deleted earlier)
83- if ! openstack server show "$server" &>/dev/null; then
84- echo "Server $server no longer exists, skipping $name."
85- continue
86- fi
87-
88- echo "Deleting cluster $cluster_prefix (server $server)..."
89- ./dev/delete-cluster.py $cluster_prefix --force
90- done
91- done
66+ echo "Deleting clusters: ${ci_clusters}"
67+ ./dev/delete-cluster.py ${ci_clusters} --force
9268 shell : bash
You can’t perform that action at this time.
0 commit comments