Merge pull request #120817 from bertinatto/fix-panic-vsphere

e2e: bootstrap vsphere tests earlier
This commit is contained in:
Kubernetes Prow Robot 2023-09-25 08:57:36 -07:00 committed by GitHub
commit 1c651cf739
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1283,6 +1283,7 @@ func (v *vSphereDriver) GetDynamicProvisionStorageClass(ctx context.Context, con
}
func (v *vSphereDriver) PrepareTest(ctx context.Context, f *framework.Framework) *storageframework.PerTestConfig {
vspheretest.Bootstrap(f)
ginkgo.DeferCleanup(func(ctx context.Context) {
// Driver Cleanup function
// Logout each vSphere client connection to prevent session leakage
@ -1302,7 +1303,6 @@ func (v *vSphereDriver) PrepareTest(ctx context.Context, f *framework.Framework)
func (v *vSphereDriver) CreateVolume(ctx context.Context, config *storageframework.PerTestConfig, volType storageframework.TestVolType) storageframework.TestVolume {
f := config.Framework
vspheretest.Bootstrap(f)
nodeInfo := vspheretest.GetReadySchedulableRandomNodeInfo(ctx, f.ClientSet)
volumePath, err := nodeInfo.VSphere.CreateVolume(&vspheretest.VolumeOptions{}, nodeInfo.DataCenterRef)
framework.ExpectNoError(err)