Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nightly cleanup to deal with duplicate server names #532

Merged
merged 4 commits into from
Jan 14, 2025
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/nightly-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,16 @@ jobs:
for cluster_prefix in ${ci_clusters}
do
echo "Processing cluster: $cluster_prefix"
TAGS=$(openstack server show ${cluster_prefix}-control --column tags --format value)
# Get all servers with the matching name for control node
CONTROL_SERVERS=$(openstack server list --name ${cluster_prefix}-control --format json)
SERVER_COUNT=$(echo "$CONTROL_SERVERS" | jq length)

if [[ $SERVER_COUNT -gt 1 ]]; then
echo "Warning: More than one server found for control node '${cluster_prefix}-control'."
continue
fi
TAGS=$(echo "$CONTROL_SERVERS" | jq -r '.[0].Tags' )
bertiethorpe marked this conversation as resolved.
Show resolved Hide resolved

if [[ $TAGS =~ "keep" ]]; then
echo "Skipping ${cluster_prefix} - control instance is tagged as keep"
else
Expand Down