From a1137f7a1a65b7f173332492caaa72f6bdeda426 Mon Sep 17 00:00:00 2001 From: Minhan Xia Date: Mon, 31 Jul 2017 16:37:02 -0700 Subject: [PATCH] fix alpha/beta endpoint when api endpoint is specified --- pkg/cloudprovider/providers/gce/gce.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cloudprovider/providers/gce/gce.go b/pkg/cloudprovider/providers/gce/gce.go index 614c08a8785..783acb3ffb8 100644 --- a/pkg/cloudprovider/providers/gce/gce.go +++ b/pkg/cloudprovider/providers/gce/gce.go @@ -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)