mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 03:57:41 +00:00
Fix nil pointer in test AfterEach for volumeperf.go
This commit is contained in:
parent
f33c4a1c79
commit
e340325024
@ -129,18 +129,25 @@ func (t *volumePerformanceTestSuite) DefineTests(driver storageframework.TestDri
|
|||||||
f.NamespacePodSecurityEnforceLevel = admissionapi.LevelPrivileged
|
f.NamespacePodSecurityEnforceLevel = admissionapi.LevelPrivileged
|
||||||
|
|
||||||
ginkgo.AfterEach(func(ctx context.Context) {
|
ginkgo.AfterEach(func(ctx context.Context) {
|
||||||
ginkgo.By("Closing informer channel")
|
if l != nil {
|
||||||
close(l.stopCh)
|
if l.stopCh != nil {
|
||||||
ginkgo.By("Deleting all PVCs")
|
ginkgo.By("Closing informer channel")
|
||||||
for _, pvc := range l.pvcs {
|
close(l.stopCh)
|
||||||
err := e2epv.DeletePersistentVolumeClaim(ctx, l.cs, pvc.Name, pvc.Namespace)
|
}
|
||||||
framework.ExpectNoError(err)
|
|
||||||
err = e2epv.WaitForPersistentVolumeDeleted(ctx, l.cs, pvc.Spec.VolumeName, 1*time.Second, 5*time.Minute)
|
ginkgo.By("Deleting all PVCs")
|
||||||
|
for _, pvc := range l.pvcs {
|
||||||
|
err := e2epv.DeletePersistentVolumeClaim(ctx, l.cs, pvc.Name, pvc.Namespace)
|
||||||
|
framework.ExpectNoError(err)
|
||||||
|
err = e2epv.WaitForPersistentVolumeDeleted(ctx, l.cs, pvc.Spec.VolumeName, 1*time.Second, 5*time.Minute)
|
||||||
|
framework.ExpectNoError(err)
|
||||||
|
}
|
||||||
|
ginkgo.By(fmt.Sprintf("Deleting Storage Class %s", l.scName))
|
||||||
|
err := l.cs.StorageV1().StorageClasses().Delete(ctx, l.scName, metav1.DeleteOptions{})
|
||||||
framework.ExpectNoError(err)
|
framework.ExpectNoError(err)
|
||||||
|
} else {
|
||||||
|
ginkgo.By("Local l setup is nil")
|
||||||
}
|
}
|
||||||
ginkgo.By(fmt.Sprintf("Deleting Storage Class %s", l.scName))
|
|
||||||
err := l.cs.StorageV1().StorageClasses().Delete(ctx, l.scName, metav1.DeleteOptions{})
|
|
||||||
framework.ExpectNoError(err)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
ginkgo.It("should provision volumes at scale within performance constraints [Slow] [Serial]", func(ctx context.Context) {
|
ginkgo.It("should provision volumes at scale within performance constraints [Slow] [Serial]", func(ctx context.Context) {
|
||||||
|
Loading…
Reference in New Issue
Block a user