From fe424d8becbe1955a2a579601c947780dfe427b7 Mon Sep 17 00:00:00 2001 From: Riley Karson Date: Thu, 14 Nov 2019 09:23:54 -0800 Subject: [PATCH 1/2] Add back support for renamed project services in reads (lost in 3.0.0) --- .../terraform/resources/resource_google_project.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/third_party/terraform/resources/resource_google_project.go b/third_party/terraform/resources/resource_google_project.go index d6655836d178..fa20953dbf43 100644 --- a/third_party/terraform/resources/resource_google_project.go +++ b/third_party/terraform/resources/resource_google_project.go @@ -535,6 +535,9 @@ func doEnableServicesRequest(services []string, project string, config *Config, } // Retrieve a project's services from the API +// if a service has been renamed, this function will list both the old and new +// forms of the service. LIST responses are expected to return only the old or +// new form, but we'll always return both. func listCurrentlyEnabledServices(project string, config *Config, timeout time.Duration) (map[string]struct{}, error) { // Verify project for services still exists p, err := config.clientResourceManager.Projects.Get(project).Do() @@ -559,10 +562,19 @@ func listCurrentlyEnabledServices(project string, config *Config, timeout time.D Filter("state:ENABLED"). Pages(ctx, func(r *serviceusage.ListServicesResponse) error { for _, v := range r.Services { - // services are returned as "projects/PROJECT/services/NAME" + // services are returned as "projects/{{project}}/services/{{name}}" name := GetResourceNameFromSelfLink(v.Name) + + // if name not in ignoredProjectServicesSet if _, ok := ignoredProjectServicesSet[name]; !ok { apiServices[name] = struct{}{} + + // if a service has been renamed, set both. We'll deal + // with setting the right values later. + if v, ok := renamedServicesByOldAndNewServiceNames[name]; ok { + log.Printf("[DEBUG] Adding service alias for %s to enabled services: %s", name, v) + apiServices[v] = struct{}{} + } } } return nil From 74d7a48d90e7465169874a613fa028fdc3b780f0 Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Thu, 14 Nov 2019 17:59:52 +0000 Subject: [PATCH 2/2] Update tracked submodules -> HEAD on Thu Nov 14 17:59:52 UTC 2019 Tracked submodules are build/terraform-beta build/terraform-mapper build/terraform build/ansible build/inspec. --- build/ansible | 2 +- build/terraform | 2 +- build/terraform-beta | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/ansible b/build/ansible index aa51f4df676d..188f2fa7a0e2 160000 --- a/build/ansible +++ b/build/ansible @@ -1 +1 @@ -Subproject commit aa51f4df676d0bba40e818e72b1bc5565f0d9c95 +Subproject commit 188f2fa7a0e2375a8fe6bfe4b4016334b3b23cf6 diff --git a/build/terraform b/build/terraform index 05e1db5432dd..6a0d5f475b11 160000 --- a/build/terraform +++ b/build/terraform @@ -1 +1 @@ -Subproject commit 05e1db5432dd2ab9c10272d674e56a33050f5236 +Subproject commit 6a0d5f475b11f3ae954d11483620de19072c094e diff --git a/build/terraform-beta b/build/terraform-beta index c80c20925654..4ead6c5f5d1d 160000 --- a/build/terraform-beta +++ b/build/terraform-beta @@ -1 +1 @@ -Subproject commit c80c2092565428cc33f994ff83f697efdab4ce20 +Subproject commit 4ead6c5f5d1daae2488da45b1e44f21d50051b9e