Merge pull request #49908 from freehan/cloud-provider-fix

Automatic merge from submit-queue (batch tested with PRs 49870, 49416, 49872, 49892, 49908)

fix alpha/beta endpoint when api endpoint is specified

fix a bug in alpha/beta compute API endpoint bootstraping when api-endpiont is specified. 

```release-note
None
```
pull/6/head
Kubernetes Submit Queue 2017-08-01 19:53:06 -07:00 committed by GitHub
commit bcc43f8f16
1 changed files with 2 additions and 2 deletions

View File

@ -290,8 +290,8 @@ func CreateGCECloud(apiEndpoint, projectID, region, zone string, managedZones []
// staging API endpoint: https://www.googleapis.com/compute/staging_v1/
if apiEndpoint != "" {
service.BasePath = fmt.Sprintf("%sprojects/", apiEndpoint)
serviceBeta.BasePath = fmt.Sprintf("%sprojects/", strings.Replace(apiEndpoint, "v1", "beta", 0))
serviceAlpha.BasePath = fmt.Sprintf("%sprojects/", strings.Replace(apiEndpoint, "v1", "alpha", 0))
serviceBeta.BasePath = fmt.Sprintf("%sprojects/", strings.Replace(apiEndpoint, "v1", "beta", -1))
serviceAlpha.BasePath = fmt.Sprintf("%sprojects/", strings.Replace(apiEndpoint, "v1", "alpha", -1))
}
containerService, err := container.New(client)