Skip to content

Commit 9262322

Browse files
authored
Merge pull request #726 from TeweiLuo/cluster-name
Add random suffix to GKE cluster name to avoid conflict.
2 parents 03d8b24 + 0def011 commit 9262322

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/k8s-integration/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ var (
4747
numNodes = flag.Int("num-nodes", -1, "the number of nodes in the test cluster")
4848
imageType = flag.String("image-type", "cos", "the image type to use for the cluster")
4949
gkeReleaseChannel = flag.String("gke-release-channel", "", "GKE release channel to be used for cluster deploy. One of 'rapid', 'stable' or 'regular'")
50-
gkeTestClusterName = flag.String("gke-cluster-name", "gcp-pd-csi-cluster", "GKE cluster name")
50+
gkeTestClusterName = flag.String("gke-cluster-name", "pdcsi", "Prefix of GKE cluster names. A random suffix will be appended to form the full name.")
5151
gkeNodeVersion = flag.String("gke-node-version", "", "GKE cluster worker node version")
5252
isRegionalCluster = flag.Bool("is-regional-cluster", false, "tell the test that a regional cluster is being used. Should be used for running on an existing regional cluster (ie, --bringup-cluster=false). The test will fail if a zonal GKE cluster is created when this flag is true")
5353

@@ -164,6 +164,8 @@ func main() {
164164
if len(*localK8sDir) == 0 {
165165
ensureVariable(testVersion, true, "Must set either test-version or local k8s dir when using deployment strategy 'gke'.")
166166
}
167+
randSuffix := string(uuid.NewUUID())[0:4]
168+
*gkeTestClusterName += randSuffix
167169
} else if *deploymentStrat == "gce" {
168170
ensureVariable(gceRegion, false, "regional clusters not supported for 'gce' deployment")
169171
ensureVariable(gceZone, true, "gce-zone required for 'gce' deployment")

0 commit comments

Comments
 (0)