Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated cherry pick of #107337: Fix the leak of vSphere client sessions #107350

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 13 additions & 4 deletions test/e2e/storage/drivers/in_tree.go
Expand Up @@ -1495,10 +1495,19 @@ func (v *vSphereDriver) GetDynamicProvisionStorageClass(config *testsuites.PerTe

func (v *vSphereDriver) PrepareTest(f *framework.Framework) (*testsuites.PerTestConfig, func()) {
return &testsuites.PerTestConfig{
Driver: v,
Prefix: "vsphere",
Framework: f,
}, func() {}
Driver: v,
Prefix: "vsphere",
Framework: f,
}, func() {
// Driver Cleanup function
// Logout each vSphere client connection to prevent session leakage
nodes := vspheretest.GetReadySchedulableNodeInfos()
for _, node := range nodes {
if node.VSphere.Client != nil {
node.VSphere.Client.Logout(context.TODO())
}
}
}
}

func (v *vSphereDriver) CreateVolume(config *testsuites.PerTestConfig, volType testpatterns.TestVolType) testsuites.TestVolume {
Expand Down