Skip to content

Commit 60b35c1

Browse files
committed
Ensure cleanup also runs without inventory
1 parent 2fa2062 commit 60b35c1

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

helpers/cleanup

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ set -euo pipefail
66

77
export CLUSTER_PREFIX="${CLUSTER_PREFIX-k8test}"
88

9-
if ! test -f k8test/cluster/inventory.yml; then
10-
exit 0
11-
fi
9+
# Make sure the k8test/helpers/release-set CLI is available
10+
source helpers/run-in-test-cluster
11+
ensure-k8test > /dev/null
1212

1313
k8test/playbooks/destroy-cluster.yml \
1414
-i k8test/cluster/inventory.yml \

helpers/run-in-test-cluster

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ function ensure-k8test() {
1919
# on the runners and cloning via SSH does not work.
2020
#
2121
# Therefore we run a separate install block that is only meant for GitHub.
22-
if [[ "${GITHUB_ACTIONS:-}" == "true" ]]; then
22+
if [[ "${GITHUB_ACTIONS:-}" == "true" ]] then
23+
if test -d k8test; then
24+
source k8test/venv/bin/activate
25+
return
26+
fi
27+
2328
mkdir -p ~/.ssh/ && touch ~/.ssh/known_hosts
2429
git clone https://github.com/cloudscale-ch/k8test
2530
python3 -m venv k8test/venv

0 commit comments

Comments
 (0)