From c57f42bcefe165ae736b1888b96199c18d682a38 Mon Sep 17 00:00:00 2001 From: Agustin Bettati Date: Tue, 10 Oct 2023 11:30:10 +0200 Subject: [PATCH] fix: cleanup-test-env script continues if delete of one project fails (#1516) --- 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