From 1d9d44b8ddd587b69c70f1c446ef6df25d31d67e Mon Sep 17 00:00:00 2001 From: Agustin Bettati Date: Tue, 10 Oct 2023 10:10:18 +0200 Subject: [PATCH] fix: cleanup-test-env script continues if delete of one project fails --- scripts/cleanup-test-env.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/cleanup-test-env.sh b/scripts/cleanup-test-env.sh index 4ba5a24097..9265f28d13 100755 --- a/scripts/cleanup-test-env.sh +++ b/scripts/cleanup-test-env.sh @@ -36,6 +36,9 @@ echo "${projects}" | jq -c '.results[].id' | while read -r id; do fi echo "Deleting projectId ${clean_project_id}" - # This command will fail if the project has a cluster inside - atlas project delete "${clean_project_id}" --force + # This command can fail if project has a cluster, a private endpoint, or general failure. The echo command always succeeds so the subshell will succeed and continue + ( + atlas project delete "${clean_project_id}" --force || \ + echo "Failed to delete project with ID ${clean_project_id}" + ) done