Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add get project perm to destroy inception #147

Merged
merged 2 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 1 ]; then
echo yes | TF_VAR_tf_state_bucket_force_destroy=true make destroy-bootstrap
else
exit 1
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
Loading