From 2102769c1441e0dfb4cffca5847423c4033dee1a Mon Sep 17 00:00:00 2001 From: Alexander Wels Date: Fri, 7 Jan 2022 08:29:13 -0600 Subject: [PATCH 1/3] Allow greater or equal in storage provisioning check The current check enforces that a dynamic provisioner creates persistent volumes of capacity equals to the persistent volume claim request size. However there are provisioners that will create persistent volumes with a capacity greater than the request size (cinder comes to mind which increments in 1Gi increments, so if you request 0.5Gi, you get 1Gi). Also provisioners that have shared storage should be reporting the total space not the request size (nfs/hostpath for instance). All these will fail the provisioning check currently because the capacity is > than the request size. This modifies the check to be capacity >= request size. Signed-off-by: Alexander Wels --- test/e2e/storage/testsuites/provisioning.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/storage/testsuites/provisioning.go b/test/e2e/storage/testsuites/provisioning.go index 14020482f9d..e1526403e92 100644 --- a/test/e2e/storage/testsuites/provisioning.go +++ b/test/e2e/storage/testsuites/provisioning.go @@ -474,11 +474,11 @@ func (t StorageClassTest) checkProvisioning(client clientset.Interface, claim *v // Check sizes expectedCapacity := resource.MustParse(t.ExpectedSize) pvCapacity := pv.Spec.Capacity[v1.ResourceName(v1.ResourceStorage)] - framework.ExpectEqual(pvCapacity.Value(), expectedCapacity.Value(), "pvCapacity is not equal to expectedCapacity") + gomega.Expect(pvCapacity.Value()).To(gomega.BeNumerically(">=", expectedCapacity.Value), "pvCapacity is not greater or equal to expectedCapacity") requestedCapacity := resource.MustParse(t.ClaimSize) claimCapacity := claim.Spec.Resources.Requests[v1.ResourceName(v1.ResourceStorage)] - framework.ExpectEqual(claimCapacity.Value(), requestedCapacity.Value(), "claimCapacity is not equal to requestedCapacity") + gomega.Expect(claimCapacity.Value()).To(gomega.BeNumerically(">=", requestedCapacity.Value), "claimCapacity is not greater or equal to requestedCapacity") // Check PV properties ginkgo.By("checking the PV") From 59dcddae475ed1a6c475480ccefeb52fa0baa034 Mon Sep 17 00:00:00 2001 From: Alexander Wels Date: Mon, 10 Jan 2022 07:00:03 -0600 Subject: [PATCH 2/3] Update test/e2e/storage/testsuites/provisioning.go Add missing brackets. Co-authored-by: Patrick Ohly --- test/e2e/storage/testsuites/provisioning.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/storage/testsuites/provisioning.go b/test/e2e/storage/testsuites/provisioning.go index e1526403e92..8d1fb717ef9 100644 --- a/test/e2e/storage/testsuites/provisioning.go +++ b/test/e2e/storage/testsuites/provisioning.go @@ -474,7 +474,7 @@ func (t StorageClassTest) checkProvisioning(client clientset.Interface, claim *v // Check sizes expectedCapacity := resource.MustParse(t.ExpectedSize) pvCapacity := pv.Spec.Capacity[v1.ResourceName(v1.ResourceStorage)] - gomega.Expect(pvCapacity.Value()).To(gomega.BeNumerically(">=", expectedCapacity.Value), "pvCapacity is not greater or equal to expectedCapacity") + gomega.Expect(pvCapacity.Value()).To(gomega.BeNumerically(">=", expectedCapacity.Value()), "pvCapacity is not greater or equal to expectedCapacity") requestedCapacity := resource.MustParse(t.ClaimSize) claimCapacity := claim.Spec.Resources.Requests[v1.ResourceName(v1.ResourceStorage)] From 8e29bb04548f5f0cbb1c692e1b450a1944c0d321 Mon Sep 17 00:00:00 2001 From: Alexander Wels Date: Mon, 10 Jan 2022 07:00:21 -0600 Subject: [PATCH 3/3] Update test/e2e/storage/testsuites/provisioning.go Add missing brackets Co-authored-by: Patrick Ohly --- test/e2e/storage/testsuites/provisioning.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/storage/testsuites/provisioning.go b/test/e2e/storage/testsuites/provisioning.go index 8d1fb717ef9..7ddd9f3e387 100644 --- a/test/e2e/storage/testsuites/provisioning.go +++ b/test/e2e/storage/testsuites/provisioning.go @@ -478,7 +478,7 @@ func (t StorageClassTest) checkProvisioning(client clientset.Interface, claim *v requestedCapacity := resource.MustParse(t.ClaimSize) claimCapacity := claim.Spec.Resources.Requests[v1.ResourceName(v1.ResourceStorage)] - gomega.Expect(claimCapacity.Value()).To(gomega.BeNumerically(">=", requestedCapacity.Value), "claimCapacity is not greater or equal to requestedCapacity") + gomega.Expect(claimCapacity.Value()).To(gomega.BeNumerically(">=", requestedCapacity.Value()), "claimCapacity is not greater or equal to requestedCapacity") // Check PV properties ginkgo.By("checking the PV")