Skip to content

Commit

Permalink
Fix compute_zones datasource (Compute client has a fixed version)
Browse files Browse the repository at this point in the history
  • Loading branch information
rileykarson authored and modular-magician committed Oct 14, 2019
1 parent 33226d9 commit 59a2e75
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@ func dataSourceGoogleComputeZonesRead(d *schema.ResourceData, meta interface{})
return err
}

regionUrl, err := replaceVars(d, config, fmt.Sprintf("{{ComputeBasePath}}projects/%s/regions/%s", project, region))
// we want to share exactly the same base path as the compute client or the
// region string may mismatch, giving us no results
// note that the client's BasePath includes a `projects/` suffix, so that'll
// need to be added to the URL below if the source changes
computeClientBasePath := config.clientCompute.BasePath

regionUrl, err := replaceVars(d, config, fmt.Sprintf("%s%s/regions/%s", computeClientBasePath, project, region))
if err != nil {
return err
}
Expand Down

0 comments on commit 59a2e75

Please sign in to comment.