Skip to content

Commit

Permalink
Remove a duplicate StorageClass creation call
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mauriciopoppe committed Sep 29, 2021
1 parent 39a3dc8 commit e15dcbe
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions test/e2e/storage/testsuites/provisioning.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e15dcbe

Please sign in to comment.