From d0a6432ee37797f8da69c116b94f94e5b1c180a8 Mon Sep 17 00:00:00 2001 From: Scott Suarez Date: Fri, 13 Aug 2021 13:39:51 -0700 Subject: [PATCH] omit /projects from compute basepath --- mmv1/third_party/terraform/utils/config.go.erb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/mmv1/third_party/terraform/utils/config.go.erb b/mmv1/third_party/terraform/utils/config.go.erb index 6266978029c9..b80126ebeda9 100644 --- a/mmv1/third_party/terraform/utils/config.go.erb +++ b/mmv1/third_party/terraform/utils/config.go.erb @@ -349,29 +349,27 @@ func (c *Config) getTokenSource(clientScopes []string, initialCredentialsOnly bo // of those "projects" as well. You can find out if this is required by looking at // the basePath value in the client library file. func (c *Config) NewComputeClient(userAgent string) *compute.Service { - computeClientBasePath := c.ComputeBasePath + "projects/" - log.Printf("[INFO] Instantiating GCE client for path %s", computeClientBasePath) + log.Printf("[INFO] Instantiating GCE client for path %s", c.ComputeBasePath) clientCompute, err := compute.NewService(c.context, option.WithHTTPClient(c.client)) if err != nil { log.Printf("[WARN] Error creating client compute: %s", err) return nil } clientCompute.UserAgent = userAgent - clientCompute.BasePath = computeClientBasePath + clientCompute.BasePath = c.ComputeBasePath return clientCompute } func (c *Config) NewComputeBetaClient(userAgent string) *computeBeta.Service { - computeBetaClientBasePath := c.ComputeBetaBasePath + "projects/" - log.Printf("[INFO] Instantiating GCE Beta client for path %s", computeBetaClientBasePath) + log.Printf("[INFO] Instantiating GCE Beta client for path %s", c.ComputeBetaBasePath) clientComputeBeta, err := computeBeta.NewService(c.context, option.WithHTTPClient(c.client)) if err != nil { log.Printf("[WARN] Error creating client compute beta: %s", err) return nil } clientComputeBeta.UserAgent = userAgent - clientComputeBeta.BasePath = computeBetaClientBasePath + clientComputeBeta.BasePath = c.ComputeBetaBasePath return clientComputeBeta }