code: func (connection *VSphereConnection) Connect(ctx context.Context) error {
  	var err error
  	clientLock.Lock()
  	defer clientLock.Unlock()
  
  	if connection.Client == nil {
  		connection.Client, err = connection.NewClient(ctx)
  		if err != nil {
  			klog.Errorf("Failed to create govmomi client. err: %+v", err)
  			return err
  		}
  		return nil
  	}
  	m := session.NewManager(connection.Client)
  	userSession, err := m.UserSession(ctx)
  	if err != nil {
  		klog.Errorf("Error while obtaining user session. err: %+v", err)
  		return err
  	}
  	if userSession != nil {
  		return nil
  	}
  	klog.Warningf("Creating new client session since the existing session is not valid or not authenticated")
  
  	connection.Client, err = connection.NewClient(ctx)
  	if err != nil {
  		klog.Errorf("Failed to create govmomi client. err: %+v", err)
  		return err
  	}
  	return nil
  }
docs: // Connect makes connection to vCenter and sets VSphereConnection.Client.
  // If connection.Client is already set, it obtains the existing user session.
  // if user session is not valid, connection.Client will be set to the new client.