build(deps): bump github.com/vmware/govmomi from 0.23.0 to 0.26.1

Bumps [github.com/vmware/govmomi](https://github.com/vmware/govmomi) from 0.23.0 to 0.26.1.
- [Release notes](https://github.com/vmware/govmomi/releases)
- [Changelog](https://github.com/vmware/govmomi/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vmware/govmomi/compare/v0.23.0...v0.26.1)

---
updated-dependencies:
- dependency-name: github.com/vmware/govmomi
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot] 2021-09-04 17:51:27 +00:00 committed by Ondřej Budai
parent 974c258382
commit 137819b9cd
77 changed files with 7610 additions and 486 deletions

View file

@ -74,7 +74,8 @@ type Client struct {
Types types.Func
UserAgent string
cookie string
cookie string
insecureCookies bool
}
var schemeMatch = regexp.MustCompile(`^\w+://`)
@ -156,6 +157,10 @@ func NewClient(u *url.URL, insecure bool) *Client {
c.u = c.URL()
c.u.User = nil
if c.u.Scheme == "http" {
c.insecureCookies = os.Getenv("GOVMOMI_INSECURE_COOKIES") == "true"
}
return &c
}
@ -219,15 +224,17 @@ func (c *Client) NewServiceClient(path string, namespace string) *Client {
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.
// SetRootCAs defines the set of PEM-encoded file locations of root certificate
// authorities the client uses when verifying server certificates instead of the
// TLS defaults which uses the host's root CA set. Multiple PEM file locations
// can be specified using the OS-specific PathListSeparator.
//
// See: http.Client.Transport.TLSClientConfig.RootCAs
func (c *Client) SetRootCAs(file string) error {
// See: http.Client.Transport.TLSClientConfig.RootCAs and
// https://pkg.go.dev/os#PathListSeparator
func (c *Client) SetRootCAs(pemPaths string) error {
pool := x509.NewCertPool()
for _, name := range filepath.SplitList(file) {
for _, name := range filepath.SplitList(pemPaths) {
pem, err := ioutil.ReadFile(filepath.Clean(name))
if err != nil {
return err
@ -476,6 +483,16 @@ func (c *Client) UnmarshalJSON(b []byte) error {
type kindContext struct{}
func (c *Client) setInsecureCookies(res *http.Response) {
cookies := res.Cookies()
if len(cookies) != 0 {
for _, cookie := range cookies {
cookie.Secure = false
}
c.Jar.SetCookies(c.u, cookies)
}
}
func (c *Client) Do(ctx context.Context, req *http.Request, f func(*http.Response) error) error {
if ctx == nil {
ctx = context.Background()
@ -513,12 +530,16 @@ func (c *Client) Do(ctx context.Context, req *http.Request, f func(*http.Respons
return err
}
defer res.Body.Close()
if d.enabled() {
d.debugResponse(res, ext)
}
if c.insecureCookies {
c.setInsecureCookies(res)
}
defer res.Body.Close()
return f(res)
}
@ -541,7 +562,7 @@ type statusError struct {
}
// Temporary returns true for HTTP response codes that can be retried
// See vim25.TemporaryNetworkError
// See vim25.IsTemporaryNetworkError
func (e *statusError) Temporary() bool {
switch e.res.StatusCode {
case http.StatusBadGateway:
@ -809,7 +830,7 @@ func (c *Client) WriteFile(ctx context.Context, file string, src io.Reader, size
if s != nil {
pr := progress.NewReader(ctx, s, src, size)
src = pr
r = pr
// Mark progress reader as done when returning from this function.
defer func() {