vSphere Cloud Provider: update vmware/gomvomi godeps
This commit is contained in:
31
vendor/github.com/vmware/govmomi/client.go
generated
vendored
31
vendor/github.com/vmware/govmomi/client.go
generated
vendored
@@ -58,7 +58,6 @@ package govmomi
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"net/url"
|
||||
|
||||
"github.com/vmware/govmomi/property"
|
||||
@@ -99,41 +98,11 @@ func NewClient(ctx context.Context, u *url.URL, insecure bool) (*Client, error)
|
||||
return c, nil
|
||||
}
|
||||
|
||||
// NewClientWithCertificate creates a new client from a URL. The client authenticates with the
|
||||
// server with the certificate before returning if the URL contains user information.
|
||||
func NewClientWithCertificate(ctx context.Context, u *url.URL, insecure bool, cert tls.Certificate) (*Client, error) {
|
||||
soapClient := soap.NewClient(u, insecure)
|
||||
soapClient.SetCertificate(cert)
|
||||
vimClient, err := vim25.NewClient(ctx, soapClient)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
c := &Client{
|
||||
Client: vimClient,
|
||||
SessionManager: session.NewManager(vimClient),
|
||||
}
|
||||
|
||||
if u.User != nil {
|
||||
err = c.LoginExtensionByCertificate(ctx, u.User.Username(), "")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
return c, nil
|
||||
}
|
||||
|
||||
// Login dispatches to the SessionManager.
|
||||
func (c *Client) Login(ctx context.Context, u *url.Userinfo) error {
|
||||
return c.SessionManager.Login(ctx, u)
|
||||
}
|
||||
|
||||
// Login dispatches to the SessionManager.
|
||||
func (c *Client) LoginExtensionByCertificate(ctx context.Context, key string, locale string) error {
|
||||
return c.SessionManager.LoginExtensionByCertificate(ctx, key, locale)
|
||||
}
|
||||
|
||||
// Logout dispatches to the SessionManager.
|
||||
func (c *Client) Logout(ctx context.Context) error {
|
||||
// Close any idle connections after logging out.
|
||||
|
||||
Reference in New Issue
Block a user