build(deps): bump the go-deps group with 10 updates

Bumps the go-deps group with 10 updates:

| Package | From | To |
| --- | --- | --- |
| [cloud.google.com/go/compute](https://github.com/googleapis/google-cloud-go) | `1.23.1` | `1.23.3` |
| [cloud.google.com/go/storage](https://github.com/googleapis/google-cloud-go) | `1.33.0` | `1.35.1` |
| [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) | `1.45.27` | `1.47.9` |
| [github.com/hashicorp/go-retryablehttp](https://github.com/hashicorp/go-retryablehttp) | `0.7.4` | `0.7.5` |
| [github.com/labstack/echo/v4](https://github.com/labstack/echo) | `4.11.2` | `4.11.3` |
| [github.com/labstack/gommon](https://github.com/labstack/gommon) | `0.4.0` | `0.4.1` |
| [github.com/openshift-online/ocm-sdk-go](https://github.com/openshift-online/ocm-sdk-go) | `0.1.374` | `0.1.385` |
| [github.com/osbuild/images](https://github.com/osbuild/images) | `0.12.0` | `0.15.0` |
| [github.com/spf13/cobra](https://github.com/spf13/cobra) | `1.7.0` | `1.8.0` |
| [golang.org/x/oauth2](https://github.com/golang/oauth2) | `0.13.0` | `0.14.0` |


Updates `cloud.google.com/go/compute` from 1.23.1 to 1.23.3
- [Release notes](https://github.com/googleapis/google-cloud-go/releases)
- [Changelog](https://github.com/googleapis/google-cloud-go/blob/main/documentai/CHANGES.md)
- [Commits](https://github.com/googleapis/google-cloud-go/compare/pubsub/v1.23.1...compute/v1.23.3)

Updates `cloud.google.com/go/storage` from 1.33.0 to 1.35.1
- [Release notes](https://github.com/googleapis/google-cloud-go/releases)
- [Changelog](https://github.com/googleapis/google-cloud-go/blob/main/CHANGES.md)
- [Commits](https://github.com/googleapis/google-cloud-go/compare/pubsub/v1.33.0...storage/v1.35.1)

Updates `github.com/aws/aws-sdk-go` from 1.45.27 to 1.47.9
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.45.27...v1.47.9)

Updates `github.com/hashicorp/go-retryablehttp` from 0.7.4 to 0.7.5
- [Changelog](https://github.com/hashicorp/go-retryablehttp/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hashicorp/go-retryablehttp/compare/v0.7.4...v0.7.5)

Updates `github.com/labstack/echo/v4` from 4.11.2 to 4.11.3
- [Release notes](https://github.com/labstack/echo/releases)
- [Changelog](https://github.com/labstack/echo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/labstack/echo/compare/v4.11.2...v4.11.3)

Updates `github.com/labstack/gommon` from 0.4.0 to 0.4.1
- [Release notes](https://github.com/labstack/gommon/releases)
- [Commits](https://github.com/labstack/gommon/compare/v0.4.0...v0.4.1)

Updates `github.com/openshift-online/ocm-sdk-go` from 0.1.374 to 0.1.385
- [Release notes](https://github.com/openshift-online/ocm-sdk-go/releases)
- [Changelog](https://github.com/openshift-online/ocm-sdk-go/blob/main/CHANGES.md)
- [Commits](https://github.com/openshift-online/ocm-sdk-go/compare/v0.1.374...v0.1.385)

Updates `github.com/osbuild/images` from 0.12.0 to 0.15.0
- [Release notes](https://github.com/osbuild/images/releases)
- [Commits](https://github.com/osbuild/images/compare/v0.12.0...v0.15.0)

Updates `github.com/spf13/cobra` from 1.7.0 to 1.8.0
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.7.0...v1.8.0)

Updates `golang.org/x/oauth2` from 0.13.0 to 0.14.0
- [Commits](https://github.com/golang/oauth2/compare/v0.13.0...v0.14.0)

---
updated-dependencies:
- dependency-name: cloud.google.com/go/compute
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-deps
- dependency-name: cloud.google.com/go/storage
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
- dependency-name: github.com/hashicorp/go-retryablehttp
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-deps
- dependency-name: github.com/labstack/echo/v4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-deps
- dependency-name: github.com/labstack/gommon
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-deps
- dependency-name: github.com/openshift-online/ocm-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-deps
- dependency-name: github.com/osbuild/images
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
- dependency-name: github.com/spf13/cobra
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
- dependency-name: golang.org/x/oauth2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot] 2023-11-13 04:25:22 +00:00 committed by Tomáš Hozza
parent 13d642bb46
commit a1e428fc53
565 changed files with 10888 additions and 5729 deletions

View file

@ -21,7 +21,6 @@ import (
"flag"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"sort"
@ -195,7 +194,7 @@ func Run(args []string) int {
}
fs := flag.NewFlagSet("", flag.ContinueOnError)
fs.SetOutput(ioutil.Discard)
fs.SetOutput(io.Discard)
ctx := context.Background()

View file

@ -24,7 +24,6 @@ import (
"flag"
"fmt"
"io"
"io/ioutil"
"net/url"
"os"
"path"
@ -63,7 +62,7 @@ func (f *ArchiveFlag) ReadOvf(fpath string) ([]byte, error) {
}
defer r.Close()
return ioutil.ReadAll(r)
return io.ReadAll(r)
}
func (f *ArchiveFlag) ReadEnvelope(data []byte) (*ovf.Envelope, error) {

View file

@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
@ -17,6 +17,7 @@ limitations under the License.
package importx
import (
"bytes"
"context"
"errors"
"flag"
@ -47,6 +48,7 @@ type ovfx struct {
Name string
VerifyManifest bool
Hidden bool
Client *vim25.Client
Datacenter *object.Datacenter
@ -77,6 +79,7 @@ func (cmd *ovfx) Register(ctx context.Context, f *flag.FlagSet) {
f.StringVar(&cmd.Name, "name", "", "Name to use for new entity")
f.BoolVar(&cmd.VerifyManifest, "m", false, "Verify checksum of uploaded files against manifest (.mf)")
f.BoolVar(&cmd.Hidden, "hidden", false, "Enable hidden properties")
}
func (cmd *ovfx) Process(ctx context.Context) error {
@ -243,6 +246,13 @@ func (cmd *ovfx) Import(fpath string) (*types.ManagedObjectReference, error) {
if e.VirtualSystem.Name != nil {
name = *e.VirtualSystem.Name
}
if cmd.Hidden {
// TODO: userConfigurable is optional and defaults to false, so we should *add* userConfigurable=true
// if not set for a Property. But, there'd be a bunch more work involved to preserve other data in doing
// a complete xml.Marshal of the .ovf
o = bytes.ReplaceAll(o, []byte(`userConfigurable="false"`), []byte(`userConfigurable="true"`))
}
}
// Override name from options if specified

View file

@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
@ -59,6 +59,8 @@ type spec struct {
*ArchiveFlag
*flags.ClientFlag
*flags.OutputFlag
hidden bool
}
func init() {
@ -73,6 +75,8 @@ func (cmd *spec) Register(ctx context.Context, f *flag.FlagSet) {
cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx)
cmd.OutputFlag.Register(ctx, f)
f.BoolVar(&cmd.hidden, "hidden", false, "Enable hidden properties")
}
func (cmd *spec) Process(ctx context.Context) error {
@ -147,7 +151,10 @@ func (cmd *spec) Map(e *ovf.Envelope) (res []Property) {
for _, p := range e.VirtualSystem.Product {
for i, v := range p.Property {
if v.UserConfigurable == nil || !*v.UserConfigurable {
if v.UserConfigurable == nil {
continue
}
if !*v.UserConfigurable && !cmd.hidden {
continue
}
@ -161,17 +168,8 @@ func (cmd *spec) Map(e *ovf.Envelope) (res []Property) {
d = strings.Title(d)
}
// From OVF spec, section 9.5.1:
// key-value-env = [class-value "."] key-value-prod ["." instance-value]
k := v.Key
if p.Class != nil {
k = fmt.Sprintf("%s.%s", *p.Class, k)
}
if p.Instance != nil {
k = fmt.Sprintf("%s.%s", k, *p.Instance)
}
np := Property{KeyValue: KeyValue{Key: p.Key(v), Value: d}}
np := Property{KeyValue: KeyValue{Key: k, Value: d}}
if cmd.Verbose() {
np.Spec = &p.Property[i]
}

View file

@ -20,7 +20,7 @@ import (
"context"
"flag"
"fmt"
"io/ioutil"
"os"
"reflect"
"strings"
@ -58,7 +58,7 @@ func (e *extraConfigFile) Set(v string) error {
var fileContents = ""
if len(r[1]) > 0 {
contents, err := ioutil.ReadFile(r[1])
contents, err := os.ReadFile(r[1])
if err != nil {
return fmt.Errorf("failed to parse extraConfigFile '%s': %w", v, err)
}

View file

@ -21,5 +21,5 @@ const (
ClientName = "govmomi"
// ClientVersion is the version of this SDK
ClientVersion = "0.32.0"
ClientVersion = "0.33.0"
)

View file

@ -1,11 +1,11 @@
/*
Copyright (c) 2015 VMware, Inc. All Rights Reserved.
Copyright (c) 2015-2023 VMware, Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
@ -16,6 +16,10 @@ limitations under the License.
package ovf
import (
"fmt"
)
type Envelope struct {
References []File `xml:"References>File"`
@ -61,6 +65,7 @@ type Content struct {
type Section struct {
Required *bool `xml:"required,attr"`
Info string `xml:"Info"`
Category string `xml:"Category"`
}
type AnnotationSection struct {
@ -85,6 +90,20 @@ type ProductSection struct {
Property []Property `xml:"Property"`
}
func (p ProductSection) Key(prop Property) string {
// From OVF spec, section 9.5.1:
// key-value-env = [class-value "."] key-value-prod ["." instance-value]
k := prop.Key
if p.Class != nil {
k = fmt.Sprintf("%s.%s", *p.Class, k)
}
if p.Instance != nil {
k = fmt.Sprintf("%s.%s", k, *p.Instance)
}
return k
}
type Property struct {
Key string `xml:"key,attr"`
Type string `xml:"type,attr"`

View file

@ -285,3 +285,31 @@ func (c *Client) GetProfileNameByID(ctx context.Context, profileID string) (stri
}
return "", fmt.Errorf("no pbm profile found with id: %q", profileID)
}
func (c *Client) QueryAssociatedProfile(ctx context.Context, entity types.PbmServerObjectRef) ([]types.PbmProfileId, error) {
req := types.PbmQueryAssociatedProfile{
This: c.ServiceContent.ProfileManager,
Entity: entity,
}
res, err := methods.PbmQueryAssociatedProfile(ctx, c, &req)
if err != nil {
return nil, err
}
return res.Returnval, nil
}
func (c *Client) QueryAssociatedProfiles(ctx context.Context, entities []types.PbmServerObjectRef) ([]types.PbmQueryProfileResult, error) {
req := types.PbmQueryAssociatedProfiles{
This: c.ServiceContent.ProfileManager,
Entities: entities,
}
res, err := methods.PbmQueryAssociatedProfiles(ctx, c, &req)
if err != nil {
return nil, err
}
return res.Returnval, nil
}

View file

@ -21,7 +21,6 @@ import (
"crypto/sha1"
"encoding/json"
"fmt"
"io/ioutil"
"net/url"
"os"
"os/user"
@ -187,7 +186,7 @@ func localTicket(ctx context.Context, m *session.Manager) (*url.Userinfo, error)
return nil, err
}
password, err := ioutil.ReadFile(ticket.PasswordFilePath)
password, err := os.ReadFile(ticket.PasswordFilePath)
if err != nil {
return nil, err
}

View file

@ -18,7 +18,6 @@ package session
import (
"context"
"io/ioutil"
"net/url"
"os"
"strings"
@ -47,7 +46,7 @@ func Secret(value string) (string, error) {
if len(value) == 0 {
return value, nil
}
contents, err := ioutil.ReadFile(value)
contents, err := os.ReadFile(value)
if err != nil {
if os.IsPermission(err) {
return "", err

View file

@ -22,7 +22,6 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"strings"
@ -32,6 +31,7 @@ import (
"github.com/vmware/govmomi/vapi/internal"
"github.com/vmware/govmomi/vim25"
"github.com/vmware/govmomi/vim25/soap"
"github.com/vmware/govmomi/vim25/types"
)
// Client extends soap.Client to support JSON encoding, while inheriting security features, debug tracing and session persistence.
@ -180,6 +180,11 @@ func (c *Client) Do(ctx context.Context, req *http.Request, resBody interface{})
}
}
// OperationID (see soap.Client.soapRoundTrip)
if id, ok := ctx.Value(types.ID{}).(string); ok {
req.Header.Add("X-Request-ID", id)
}
if headers, ok := ctx.Value(headersContext{}).(http.Header); ok {
for k, v := range headers {
for _, v := range v {
@ -195,7 +200,7 @@ func (c *Client) Do(ctx context.Context, req *http.Request, resBody interface{})
case http.StatusNoContent:
case http.StatusBadRequest:
// TODO: structured error types
detail, err := ioutil.ReadAll(res.Body)
detail, err := io.ReadAll(res.Body)
if err != nil {
return err
}

View file

@ -34,29 +34,41 @@ func NewListView(c *vim25.Client, ref types.ManagedObjectReference) *ListView {
}
}
func (v ListView) Add(ctx context.Context, refs []types.ManagedObjectReference) error {
func (v ListView) Add(ctx context.Context, refs []types.ManagedObjectReference) ([]types.ManagedObjectReference, error) {
req := types.ModifyListView{
This: v.Reference(),
Add: refs,
}
_, err := methods.ModifyListView(ctx, v.Client(), &req)
return err
res, err := methods.ModifyListView(ctx, v.Client(), &req)
if err != nil {
return nil, err
}
return res.Returnval, nil
}
func (v ListView) Remove(ctx context.Context, refs []types.ManagedObjectReference) error {
func (v ListView) Remove(ctx context.Context, refs []types.ManagedObjectReference) ([]types.ManagedObjectReference, error) {
req := types.ModifyListView{
This: v.Reference(),
Remove: refs,
}
_, err := methods.ModifyListView(ctx, v.Client(), &req)
return err
res, err := methods.ModifyListView(ctx, v.Client(), &req)
if err != nil {
return nil, err
}
return res.Returnval, nil
}
func (v ListView) Reset(ctx context.Context, refs []types.ManagedObjectReference) error {
func (v ListView) Reset(ctx context.Context, refs []types.ManagedObjectReference) ([]types.ManagedObjectReference, error) {
req := types.ResetListView{
This: v.Reference(),
Obj: refs,
}
_, err := methods.ResetListView(ctx, v.Client(), &req)
return err
res, err := methods.ResetListView(ctx, v.Client(), &req)
if err != nil {
return nil, err
}
return res.Returnval, nil
}

View file

@ -73,7 +73,7 @@ func (v TaskView) Collect(ctx context.Context, f func([]types.TaskInfo)) error {
tasks = change.Val.(types.ArrayOfManagedObjectReference).ManagedObjectReference
if len(tasks) != 0 {
reset = func() {
_ = v.Reset(ctx, tasks)
_, _ = v.Reset(ctx, tasks)
// Remember any tasks we've reported as complete already,
// to avoid reporting multiple times when Reset is triggered.
@ -113,7 +113,7 @@ func (v TaskView) Collect(ctx context.Context, f func([]types.TaskInfo)) error {
if reset != nil {
reset()
} else if len(prune) != 0 {
_ = v.Remove(ctx, prune)
_, _ = v.Remove(ctx, prune)
}
if len(tasks) != 0 && len(infos) == 0 {

View file

@ -27,7 +27,6 @@ import (
"errors"
"fmt"
"io"
"io/ioutil"
"log"
"net"
"net/http"
@ -267,7 +266,7 @@ func (c *Client) SetRootCAs(pemPaths string) error {
pool := x509.NewCertPool()
for _, name := range filepath.SplitList(pemPaths) {
pem, err := ioutil.ReadFile(filepath.Clean(name))
pem, err := os.ReadFile(filepath.Clean(name))
if err != nil {
return err
}
@ -319,6 +318,20 @@ func (c *Client) Thumbprint(host string) string {
return c.hosts[host]
}
// KnownThumbprint checks whether the provided thumbprint is known to this client.
func (c *Client) KnownThumbprint(tp string) bool {
c.hostsMu.Lock()
defer c.hostsMu.Unlock()
for _, v := range c.hosts {
if v == tp {
return true
}
}
return false
}
// LoadThumbprints from file with the give name.
// If name is empty or name does not exist this function will return nil.
func (c *Client) LoadThumbprints(file string) error {