Skip to content

Commit

Permalink
fix: add get project perm to destroy inception
Browse files Browse the repository at this point in the history
  • Loading branch information
krtk6160 committed Nov 9, 2023
1 parent 9288e54 commit 287ed66
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
12 changes: 8 additions & 4 deletions ci/tasks/gcp/teardown.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,15 @@ gcloud compute ssh --ssh-key-file=${CI_ROOT}/login.ssh ${bastion_name} --zone=${
echo yes | make destroy-platform

# Sometimes a resource deletion fails if a dependent resource is still being deleted
success=0
for i in {1..5}; do
echo yes | GOOGLE_CREDENTIALS=$(cat inception-sa-creds.json) make destroy-inception && break
echo "Attempt $i failed. Retrying..."
echo "Attempt $i to destroy inception"
echo yes | GOOGLE_CREDENTIALS=$(cat inception-sa-creds.json) make destroy-inception && success=1 && break
sleep 10
done

echo yes | TF_VAR_tf_state_bucket_force_destroy=true make destroy-bootstrap

if [ $success -eq 0 ]; then
exit 1
else
echo yes | TF_VAR_tf_state_bucket_force_destroy=true make destroy-bootstrap
fi
1 change: 1 addition & 0 deletions modules/inception/gcp/inception-roles.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ resource "google_project_iam_custom_role" "inception_destroy" {
"iam.serviceAccounts.delete",
"iam.roles.delete",
"storage.buckets.delete",
"resourcemanager.projects.get",
"servicenetworking.services.get",
"servicenetworking.services.deleteConnection",
"serviceusage.operations.get"
Expand Down

0 comments on commit 287ed66

Please sign in to comment.