From a01381a7d2393c6b5d1b51766b49a3633761f6fa Mon Sep 17 00:00:00 2001 From: Kenichi Omichi Date: Fri, 15 Feb 2019 20:07:11 +0000 Subject: [PATCH] Call getRandomClusterZone() only if necessary e2e test "[It] should provision storage with different parameters" depends on cloud providers as gce/gke, aws, openstack, vsphere and azure. If the other cloud providers like local, the test is skipped. However getRandomClusterZone() was called before the above cloud provider check, and if the zone label is not found the test was failed. This makes the test call getRandomClusterZone() only if necessary to avoid such unnecessary failures. Fixes: #73771 --- test/e2e/storage/volume_provisioning.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/e2e/storage/volume_provisioning.go b/test/e2e/storage/volume_provisioning.go index 7e2cb745675..ffc6d86bf02 100644 --- a/test/e2e/storage/volume_provisioning.go +++ b/test/e2e/storage/volume_provisioning.go @@ -257,7 +257,6 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() { Describe("DynamicProvisioner [Slow]", func() { It("should provision storage with different parameters", func() { - cloudZone := getRandomClusterZone(c) // This test checks that dynamic provisioning can provision a volume // that can be used to persist data among pods. @@ -269,7 +268,7 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() { Provisioner: "kubernetes.io/gce-pd", Parameters: map[string]string{ "type": "pd-ssd", - "zone": cloudZone, + "zone": getRandomClusterZone(c), }, ClaimSize: "1.5Gi", ExpectedSize: "2Gi", @@ -301,7 +300,7 @@ var _ = utils.SIGDescribe("Dynamic Provisioning", func() { Provisioner: "kubernetes.io/aws-ebs", Parameters: map[string]string{ "type": "gp2", - "zone": cloudZone, + "zone": getRandomClusterZone(c), }, ClaimSize: "1.5Gi", ExpectedSize: "2Gi",