mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-26 19:35:10 +00:00
PBM govmomi dependencies
This commit is contained in:
committed by
System Administrator
parent
199465c3a5
commit
23ee1745d3
34
vendor/github.com/vmware/govmomi/vim25/soap/client.go
generated
vendored
34
vendor/github.com/vmware/govmomi/vim25/soap/client.go
generated
vendored
@@ -58,6 +58,10 @@ const (
|
||||
DefaultMinVimVersion = "5.5"
|
||||
)
|
||||
|
||||
type header struct {
|
||||
Cookie string `xml:"vcSessionCookie,omitempty"`
|
||||
}
|
||||
|
||||
type Client struct {
|
||||
http.Client
|
||||
|
||||
@@ -73,6 +77,8 @@ type Client struct {
|
||||
Namespace string // Vim namespace
|
||||
Version string // Vim version
|
||||
UserAgent string
|
||||
|
||||
header *header
|
||||
}
|
||||
|
||||
var schemeMatch = regexp.MustCompile(`^\w+://`)
|
||||
@@ -147,6 +153,32 @@ func NewClient(u *url.URL, insecure bool) *Client {
|
||||
return &c
|
||||
}
|
||||
|
||||
// NewServiceClient creates a NewClient with the given URL.Path and namespace.
|
||||
func (c *Client) NewServiceClient(path string, namespace string) *Client {
|
||||
u := c.URL()
|
||||
u.Path = path
|
||||
|
||||
client := NewClient(u, c.k)
|
||||
|
||||
client.Namespace = namespace
|
||||
|
||||
// Copy the cookies
|
||||
client.Client.Jar.SetCookies(u, c.Client.Jar.Cookies(u))
|
||||
|
||||
// Set SOAP Header cookie
|
||||
for _, cookie := range client.Jar.Cookies(u) {
|
||||
if cookie.Name == "vmware_soap_session" {
|
||||
client.header = &header{
|
||||
Cookie: cookie.Value,
|
||||
}
|
||||
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return client
|
||||
}
|
||||
|
||||
// SetRootCAs defines the set of root certificate authorities
|
||||
// that clients use when verifying server certificates.
|
||||
// By default TLS uses the host's root CA set.
|
||||
@@ -401,6 +433,8 @@ func (c *Client) RoundTrip(ctx context.Context, reqBody, resBody HasFault) error
|
||||
reqEnv := Envelope{Body: reqBody}
|
||||
resEnv := Envelope{Body: resBody}
|
||||
|
||||
reqEnv.Header = c.header
|
||||
|
||||
// Create debugging context for this round trip
|
||||
d := c.d.newRoundTrip()
|
||||
if d.enabled() {
|
||||
|
||||
Reference in New Issue
Block a user