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
This commit is contained in:
Kenichi Omichi 2019-02-15 20:07:11 +00:00
parent 07da603b59
commit a01381a7d2

View File

@ -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",