From 144e6432cf13941b44be30d1740a7e86502e0a6e Mon Sep 17 00:00:00 2001 From: Mauricio Poppe Date: Wed, 15 Sep 2021 19:09:35 +0000 Subject: [PATCH] Remove a duplicate StorageClass creation call The issue on both tests is that before the refactor we had a method that was creating the `StorageClass` manifest only, this manifest was used later to be created by `TestBindingWaitForFirstConsumerMultiPVC`, after the refactor we're ensuring that the `StorageClass` exists as a resource before calling `TestBindingWaitForFirstConsumerMultiPVC` however this method is still attempting to create it, that's the reason behind the error: `resourceVersion should not be set on objects to be created This issue wasn't caught before because `TestBindingWaitForFirstConsumerMultiPVC` is creating the StorageClass without the common utility function, the solution is to remove the snippet that attempts to create the StorageClass againo --- test/e2e/storage/testsuites/provisioning.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/test/e2e/storage/testsuites/provisioning.go b/test/e2e/storage/testsuites/provisioning.go index 579321d8370..03717e210b6 100644 --- a/test/e2e/storage/testsuites/provisioning.go +++ b/test/e2e/storage/testsuites/provisioning.go @@ -612,14 +612,6 @@ func (t StorageClassTest) TestBindingWaitForFirstConsumerMultiPVC(claims []*v1.P framework.ExpectNotEqual(len(claims), 0) namespace := claims[0].Namespace - ginkgo.By("creating a storage class " + t.Class.Name) - class, err := t.Client.StorageV1().StorageClasses().Create(context.TODO(), t.Class, metav1.CreateOptions{}) - framework.ExpectNoError(err) - defer func() { - err = storageutils.DeleteStorageClass(t.Client, class.Name) - framework.ExpectNoError(err, "While deleting storage class") - }() - ginkgo.By("creating claims") var claimNames []string var createdClaims []*v1.PersistentVolumeClaim