Skip to content

Commit

Permalink
fix: cleanup-test-env script continues if delete of one project fails (
Browse files Browse the repository at this point in the history
  • Loading branch information
AgustinBettati authored Oct 10, 2023
1 parent f14f602 commit c57f42b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/cleanup-test-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c57f42b

Please sign in to comment.