mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
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
This commit is contained in:
parent
34fb61beba
commit
144e6432cf
@ -612,14 +612,6 @@ func (t StorageClassTest) TestBindingWaitForFirstConsumerMultiPVC(claims []*v1.P
|
|||||||
framework.ExpectNotEqual(len(claims), 0)
|
framework.ExpectNotEqual(len(claims), 0)
|
||||||
namespace := claims[0].Namespace
|
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")
|
ginkgo.By("creating claims")
|
||||||
var claimNames []string
|
var claimNames []string
|
||||||
var createdClaims []*v1.PersistentVolumeClaim
|
var createdClaims []*v1.PersistentVolumeClaim
|
||||||
|
Loading…
Reference in New Issue
Block a user