Skip to content

Commit 79976f8

Browse files
committed
Updated VC conn cleaner to reset all the clients
1 parent 17ce001 commit 79976f8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/common/cns-lib/vsphere/virtualcenter.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,13 @@ func (vc *VirtualCenter) cleanupVCClient(ctx context.Context) {
283283
if err := vc.Client.Logout(ctx); err != nil {
284284
log.With("err", err).Warn("Could not logout of VC session")
285285
}
286+
287+
// nullifies all the clients so that they are created anew during next Connection attempt
286288
vc.Client = nil
289+
vc.PbmClient = nil
290+
vc.CnsClient = nil
291+
vc.VsanClient = nil
292+
vc.VslmClient = nil
287293
}
288294

289295
// Connect establishes a new connection with vSphere with updated credentials.

0 commit comments

Comments
 (0)