fix alpha/beta endpoint when api endpoint is specified

pull/6/head
Minhan Xia 2017-07-31 16:37:02 -07:00
parent 0c447c59db
commit a1137f7a1a
1 changed files with 2 additions and 2 deletions

View File

@ -281,8 +281,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)