diff --git a/cluster/gke/util.sh b/cluster/gke/util.sh index 3146211b951..83705e2508c 100755 --- a/cluster/gke/util.sh +++ b/cluster/gke/util.sh @@ -249,6 +249,21 @@ function detect-minion-names { echo "MINION_NAMES=${MINION_NAMES[*]}" } +# Detect instance group name generated by gke +# +# Assumed vars: +# GCLOUD +# PROJECT +# ZONE +# CLUSTER_NAME +# Vars set: +# NODE_INSTANCE_GROUP +function detect-node-instance-group { + NODE_INSTANCE_GROUP=$("${GCLOUD}" alpha container clusters describe \ + --project="${PROJECT}" --zone="${ZONE}" "${CLUSTER_NAME}" \ + | grep instanceGroupManagers | cut -d '/' -f 11) +} + # SSH to a node by name ($1) and run a command ($2). # # Assumed vars: diff --git a/hack/ginkgo-e2e.sh b/hack/ginkgo-e2e.sh index a9821cc152c..4183597a62d 100755 --- a/hack/ginkgo-e2e.sh +++ b/hack/ginkgo-e2e.sh @@ -83,6 +83,10 @@ else NODE_INSTANCE_GROUP="" fi +if [[ "${KUBERNETES_PROVIDER}" == "gke" ]]; then + detect-node-instance-group +fi + ginkgo_args=() if [[ ${GINKGO_PARALLEL} =~ ^[yY]$ ]]; then ginkgo_args+=("-p") diff --git a/test/e2e/resize_nodes.go b/test/e2e/resize_nodes.go index 4bdbe627f56..57deeb87c03 100644 --- a/test/e2e/resize_nodes.go +++ b/test/e2e/resize_nodes.go @@ -77,7 +77,7 @@ func waitForNodeInstanceGroupSize(size int) error { continue } if currentSize != size { - Logf("Waiting for node istance group size %d, current size %d", size, currentSize) + Logf("Waiting for node instance group size %d, current size %d", size, currentSize) continue } Logf("Node instance group has reached the desired size %d", size) @@ -224,7 +224,7 @@ func waitForPodsCreatedRunningResponding(c *client.Client, ns, name string, repl } var _ = Describe("Nodes", func() { - supportedProviders := []string{"gce"} + supportedProviders := []string{"gce", "gke"} var testName string var c *client.Client var ns string