Skip to content

Commit 7a40dd9

Browse files
committed
Revert "fix the "gcloud services enable" logic"
This reverts commit 40d453a.
1 parent d504436 commit 7a40dd9

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

test/k8s-integration/cluster.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"os"
88
"os/exec"
99
"path/filepath"
10-
"regexp"
1110
"strconv"
1211
"strings"
1312

@@ -162,16 +161,13 @@ func setImageTypeEnvs(imageType string) error {
162161

163162
func clusterUpGKE(gceZone, gceRegion string, numNodes int, numWindowsNodes int, imageType string, useManagedDriver bool) error {
164163
// Enable the GKE service API
165-
var gkeServiceName string
166164
gkeURL := os.Getenv("CLOUDSDK_API_ENDPOINT_OVERRIDES_CONTAINER")
167165
if gkeURL == "" {
168-
gkeServiceName = "container.googleapis.com"
169-
} else {
170-
gkeServiceName = regexp.MustCompile("https://(.+)/").FindStringSubmatch(gkeURL)[1]
166+
gkeURL = "container.googleapis.com"
171167
}
172-
_, err := exec.Command("gcloud", "services", "enable", gkeServiceName).CombinedOutput()
168+
_, err := exec.Command("gcloud", "services", "enable", gkeURL).CombinedOutput()
173169
if err != nil {
174-
return fmt.Errorf("failed to enable GKE service API %q: %v", gkeServiceName, err)
170+
return fmt.Errorf("failed to enable GKE service API %q: %v", gkeURL, err)
175171
}
176172

177173
locationArg, locationVal, err := gkeLocationArgs(gceZone, gceRegion)

0 commit comments

Comments
 (0)