Skip to content

Commit 882ed7e

Browse files
authored
Don't fail cluster cleanup when prefix not found
1 parent 969c6f2 commit 882ed7e

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

.github/workflows/nightly-cleanup.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- SMS
1212
- ARCUS
1313
schedule:
14-
- cron: '0 20 * * *' # Run at 8PM - image sync runs at midnight
14+
- cron: '0 21 * * *' # Run at 9PM - image sync runs at midnight
1515

1616
jobs:
1717
ci_cleanup:
@@ -52,13 +52,23 @@ jobs:
5252
- name: Find CI clusters
5353
run: |
5454
. venv/bin/activate
55-
CI_CLUSTERS=$(openstack server list | grep --only-matching 'slurmci-RL.-[0-9]\+' | sort | uniq)
56-
echo "ci_clusters=${CI_CLUSTERS}" >> GITHUB_ENV
55+
CI_CLUSTERS=$(openstack server list | grep --only-matching 'slurmci-RL.-[0-9]\+' | sort | uniq || true)
56+
if [[ -z "$CI_CLUSTERS" ]]; then
57+
echo "No matching CI clusters found."
58+
else
59+
echo "Found clusters: $CI_CLUSTERS"
60+
echo "ci_clusters=${CI_CLUSTERS}" >> GITHUB_ENV
61+
fi
5762
shell: bash
5863

5964
- name: Delete clusters if control node not tagged with keep
6065
run: |
6166
. venv/bin/activate
67+
if [[ -z "${CI_CLUSTERS}" ]]; then
68+
echo "No clusters to delete."
69+
exit 0
70+
fi
71+
6272
for cluster_prefix in ${CI_CLUSTERS}
6373
do
6474
TAGS=$(openstack server show ${cluster_prefix}-control --column tags --format value)

0 commit comments

Comments
 (0)