Skip to content

Commit 05d688e

Browse files
author
Jeff Peeler
committed
fix(scripts): clean up all resources when done
This deletes everything helm produces to ensure the cluster is in a good state when finished. (The primary goal of this was to delete the additional created namespace, but why not clean up everything else too.)
1 parent 02fab2e commit 05d688e

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

scripts/run_e2e_docker.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ cp test/e2e/e2e-values.yaml "$test_e2e_config"
2020
./scripts/package-release.sh 1.0.0-e2e test/e2e/resources "$test_e2e_config"
2121

2222
function cleanup {
23-
kubectl delete namespace "${namespace}"
23+
for resource in test/e2e/test-resources/*.yaml; do
24+
[ -e "$resource" ] || continue
25+
echo "Running kubectl delete -f $resource..."
26+
kubectl delete -f "$resource" &> /dev/null || continue
27+
done
2428
rm -rf test/e2e/resources
2529
rm -rf test/e2e/test-resources
2630
}

scripts/run_e2e_local.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ cp test/e2e/e2e-values.yaml "$test_e2e_config"
2121
./scripts/package-release.sh 1.0.0-e2e test/e2e/resources "$test_e2e_config"
2222

2323
function cleanup {
24-
kubectl delete namespace "${namespace}"
24+
for resource in test/e2e/resources/*.yaml; do
25+
[ -e "$resource" ] || continue
26+
echo "Running kubectl delete -f $resource..."
27+
kubectl delete -f "$resource" &> /dev/null || continue
28+
done
2529
rm -rf test/e2e/resources
2630
}
2731

0 commit comments

Comments
 (0)