From a61b33bbf8fe1da558dba504cc551fb50b220950 Mon Sep 17 00:00:00 2001 From: Paddy Carver Date: Tue, 30 Jul 2019 22:41:15 -0700 Subject: [PATCH 1/2] Catch 404s when deleting default networks. As seen in terraform-providers/terraform-provider-google#3582, it is now possible to set an organization policy that removes the default network from a project when it's created. This means it's now possible that Terraform's attempt to delete that default network will encounter an error saying the network is not found. Because what Terraform wanted was achieved, even if not by Terraform, we shouldn't raise that error, we should ignore it. --- third_party/terraform/resources/resource_google_project.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/third_party/terraform/resources/resource_google_project.go b/third_party/terraform/resources/resource_google_project.go index bd70cf43baa1..7ef8bc854ee5 100644 --- a/third_party/terraform/resources/resource_google_project.go +++ b/third_party/terraform/resources/resource_google_project.go @@ -274,7 +274,11 @@ func resourceGoogleProjectCreate(d *schema.ResourceData, meta interface{}) error } if err = forceDeleteComputeNetwork(project.ProjectId, "default", config); err != nil { - return fmt.Errorf("Error deleting default network in project %s: %s", project.ProjectId, err) + if isGoogleApiErrorWithCode(err, 404) { + log.Printf("[DEBUG] Default network not found for project %q, no need to delete it", project.ProjectId) + } else { + return fmt.Errorf("Error deleting default network in project %s: %s", project.ProjectId, err) + } } } return nil From dc4308419747e277e21aabaa826298f83d8e4011 Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Mon, 12 Aug 2019 19:30:48 +0000 Subject: [PATCH 2/2] Update tracked submodules -> HEAD on Mon Aug 12 19:30:48 UTC 2019 Tracked submodules are build/terraform-beta build/terraform-mapper build/terraform build/ansible build/inspec. --- build/terraform | 2 +- build/terraform-beta | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/terraform b/build/terraform index 92e352dcafa7..bcf010a9581f 160000 --- a/build/terraform +++ b/build/terraform @@ -1 +1 @@ -Subproject commit 92e352dcafa7e1b467a9cfcdd77e43ee4b41e3c7 +Subproject commit bcf010a9581fc5a91cbde7e8d7c8d41b45b58777 diff --git a/build/terraform-beta b/build/terraform-beta index 3ddb7b9116a9..9ad3f858ba37 160000 --- a/build/terraform-beta +++ b/build/terraform-beta @@ -1 +1 @@ -Subproject commit 3ddb7b9116a921a8b126a3ee2cb22636cbe7d763 +Subproject commit 9ad3f858ba3721b0562bad0e18afc922d156db64