go.mod: update images to 0.11

Mainly to include:

- distro/rhel9: Make /boot 600 MiB big on RHEL 9.3+
- fedora: exclude sdubby
- Minimal image builds

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
Ondřej Budai 2023-10-06 10:00:29 +02:00 committed by Ondřej Budai
parent edc45fde72
commit 19edaca01a
213 changed files with 4113 additions and 3823 deletions

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,
@ -180,7 +180,7 @@ func (cmd *info) Run(ctx context.Context, f *flag.FlagSet) error {
}
type infoResult struct {
Datastores []mo.Datastore
Datastores []mo.Datastore `json:"datastores"`
objects []*object.Datastore
}

94
vendor/github.com/vmware/govmomi/govc/flags/env.go generated vendored Normal file
View file

@ -0,0 +1,94 @@
/*
Copyright (c) 2023-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
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package flags
import (
"context"
"flag"
"github.com/vmware/govmomi/object"
"github.com/vmware/govmomi/vim25/mo"
)
type EnvBrowser struct {
*ClusterFlag
*HostSystemFlag
*VirtualMachineFlag
}
func (cmd *EnvBrowser) Register(ctx context.Context, f *flag.FlagSet) {
cmd.ClusterFlag, ctx = NewClusterFlag(ctx)
cmd.ClusterFlag.Register(ctx, f)
cmd.HostSystemFlag, ctx = NewHostSystemFlag(ctx)
cmd.HostSystemFlag.Register(ctx, f)
cmd.VirtualMachineFlag, ctx = NewVirtualMachineFlag(ctx)
cmd.VirtualMachineFlag.Register(ctx, f)
}
func (cmd *EnvBrowser) Process(ctx context.Context) error {
if err := cmd.ClusterFlag.Process(ctx); err != nil {
return err
}
if err := cmd.HostSystemFlag.Process(ctx); err != nil {
return err
}
return cmd.VirtualMachineFlag.Process(ctx)
}
func (cmd *EnvBrowser) Browser(ctx context.Context) (*object.EnvironmentBrowser, error) {
c, err := cmd.VirtualMachineFlag.Client()
if err != nil {
return nil, err
}
vm, err := cmd.VirtualMachine()
if err != nil {
return nil, err
}
if vm != nil {
return vm.EnvironmentBrowser(ctx)
}
host, err := cmd.HostSystemIfSpecified()
if err != nil {
return nil, err
}
if host != nil {
var h mo.HostSystem
err = host.Properties(ctx, host.Reference(), []string{"parent"}, &h)
if err != nil {
return nil, err
}
return object.NewComputeResource(c, *h.Parent).EnvironmentBrowser(ctx)
}
finder, ferr := cmd.ClusterFlag.Finder()
if ferr != nil {
return nil, ferr
}
cr, ferr := finder.ComputeResourceOrDefault(ctx, cmd.ClusterFlag.Name)
if ferr != nil {
return nil, ferr
}
return cr.EnvironmentBrowser(ctx)
}

View file

@ -1,11 +1,11 @@
/*
Copyright (c) 2014 VMware, Inc. All Rights Reserved.
Copyright (c) 2014-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,
@ -31,33 +31,33 @@ type Command struct {
}
type CommandInfoItem struct {
Name string `xml:"name"`
DisplayName string `xml:"displayName"`
Help string `xml:"help"`
Name string `xml:"name" json:"name"`
DisplayName string `xml:"displayName" json:"displayName"`
Help string `xml:"help" json:"help"`
}
type CommandInfoParam struct {
CommandInfoItem
Aliases []string `xml:"aliases"`
Flag bool `xml:"flag"`
Aliases []string `xml:"aliases" json:"aliases"`
Flag bool `xml:"flag" json:"flag"`
}
type CommandInfoHint struct {
Key string `xml:"key"`
Value string `xml:"value"`
Key string `xml:"key" json:"key"`
Value string `xml:"value" json:"value"`
}
type CommandInfoHints []CommandInfoHint
type CommandInfoMethod struct {
CommandInfoItem
Param []CommandInfoParam `xml:"param"`
Hints CommandInfoHints `xml:"hints"`
Param []CommandInfoParam `xml:"param" json:"param"`
Hints CommandInfoHints `xml:"hints" json:"hints"`
}
type CommandInfo struct {
CommandInfoItem
Method []*CommandInfoMethod `xml:"method"`
Method []*CommandInfoMethod `xml:"method" json:"method"`
}
func NewCommand(args []string) *Command {

View file

@ -27,8 +27,8 @@ import (
)
type Fault struct {
Message string
Detail string
Message string `json:"message"`
Detail string `json:"detail"`
}
func (f Fault) Error() string {

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,
@ -19,9 +19,9 @@ package esxcli
import "github.com/vmware/govmomi/object"
type FirewallInfo struct {
Loaded bool
Enabled bool
DefaultAction string
Loaded bool `json:"loaded"`
Enabled bool `json:"enabled"`
DefaultAction string `json:"defaultAction"`
}
// GetFirewallInfo via 'esxcli network firewall get'

View file

@ -24,9 +24,9 @@ import (
type Values map[string][]string
type Response struct {
Info *CommandInfoMethod
Values []Values
String string
Info *CommandInfoMethod `json:"info"`
Values []Values `json:"values"`
String string `json:"string"`
}
func (v Values) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {

View file

@ -1,5 +1,5 @@
/*
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.
@ -29,8 +29,39 @@ import (
"github.com/vmware/govmomi/vim25/types"
)
type KeyValue struct {
Key string
Value string
}
// case insensitive for Key + Value
func (kv *KeyValue) UnmarshalJSON(b []byte) error {
e := struct {
types.KeyValue
Key *string
Value *string
}{
types.KeyValue{}, &kv.Key, &kv.Value,
}
err := json.Unmarshal(b, &e)
if err != nil {
return err
}
if kv.Key == "" {
kv.Key = e.KeyValue.Key // "key"
}
if kv.Value == "" {
kv.Value = e.KeyValue.Value // "value"
}
return nil
}
type Property struct {
types.KeyValue
KeyValue
Spec *ovf.Property `json:",omitempty"`
}

View file

@ -1,5 +1,5 @@
/*
Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved.
Copyright (c) 2014-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.
@ -161,7 +161,10 @@ func (cmd *ovfx) Prepare(f *flag.FlagSet) (string, error) {
func (cmd *ovfx) Map(op []Property) (p []types.KeyValue) {
for _, v := range op {
p = append(p, v.KeyValue)
p = append(p, types.KeyValue{
Key: v.Key,
Value: v.Value,
})
}
return

View file

@ -1,5 +1,5 @@
/*
Copyright (c) 2015-2016 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.
@ -171,7 +171,7 @@ func (cmd *spec) Map(e *ovf.Envelope) (res []Property) {
k = fmt.Sprintf("%s.%s", k, *p.Instance)
}
np := Property{KeyValue: types.KeyValue{Key: k, Value: d}}
np := Property{KeyValue: KeyValue{Key: k, Value: d}}
if cmd.Verbose() {
np.Spec = &p.Property[i]
}

View file

@ -1,11 +1,11 @@
/*
Copyright (c) 2014-2017 VMware, Inc. All Rights Reserved.
Copyright (c) 2014-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,
@ -159,7 +159,7 @@ func (cmd *ps) Run(ctx context.Context, f *flag.FlagSet) error {
type psResult struct {
cmd *ps
ProcessInfo []types.GuestProcessInfo
ProcessInfo []types.GuestProcessInfo `json:"processInfo"`
}
func (r *psResult) Write(w io.Writer) error {

View file

@ -1,11 +1,11 @@
/*
Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved.
Copyright (c) 2014-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,
@ -175,7 +175,7 @@ func (cmd *info) Run(ctx context.Context, f *flag.FlagSet) error {
}
type infoResult struct {
VirtualMachines []mo.VirtualMachine
VirtualMachines []mo.VirtualMachine `json:"virtualMachines"`
objects []*object.VirtualMachine
entities map[types.ManagedObjectReference]string
cmd *info

View file

@ -1,11 +1,11 @@
/*
Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved.
Copyright (c) 2014-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,
@ -68,7 +68,7 @@ func (cmd *ip) Description() string {
By default the vm.ip command depends on vmware-tools to report the 'guest.ipAddress' field and will
wait until it has done so. This value can also be obtained using:
govc vm.info -json $vm | jq -r .VirtualMachines[].Guest.IpAddress
govc vm.info -json $vm | jq -r .virtualMachines[].guest.ipAddress
When given the '-a' flag, only IP addresses for which there is a corresponding virtual nic are listed.
If there are multiple nics, the listed addresses will be comma delimited. The '-a' flag depends on
@ -78,7 +78,7 @@ by tools for which there is no virtual nic are not included, for example that of
These values can also be obtained using:
govc vm.info -json $vm | jq -r .VirtualMachines[].Guest.Net[].IpConfig.IpAddress[].IpAddress
govc vm.info -json $vm | jq -r .virtualMachines[].guest.net[].ipConfig.ipAddress[].ipAddress
When given the '-n' flag, filters '-a' behavior to the nic specified by MAC address or device name.

View file

@ -284,6 +284,7 @@ func (c *Client) Download(ctx context.Context, src string) (io.ReadCloser, int64
}
p := soap.DefaultDownload
p.Close = true // disable Keep-Alive connection to ESX
if internal.UsingEnvoySidecar(c.ProcessManager.Client()) {
vc = internal.ClientWithEnvoyHostGateway(vc)
@ -346,6 +347,8 @@ func (c *Client) Upload(ctx context.Context, src io.Reader, dst string, p soap.U
return err
}
p.Close = true // disable Keep-Alive connection to ESX
if internal.UsingEnvoySidecar(c.ProcessManager.Client()) {
vc = internal.ClientWithEnvoyHostGateway(vc)
}

View file

@ -21,5 +21,5 @@ const (
ClientName = "govmomi"
// ClientVersion is the version of this SDK
ClientVersion = "0.31.0"
ClientVersion = "0.32.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,
@ -18,6 +18,7 @@ package object
import (
"context"
"fmt"
"path"
"github.com/vmware/govmomi/property"
@ -84,6 +85,21 @@ func (c ComputeResource) Datastores(ctx context.Context) ([]*Datastore, error) {
return dss, nil
}
func (c ComputeResource) EnvironmentBrowser(ctx context.Context) (*EnvironmentBrowser, error) {
var cr mo.ComputeResource
err := c.Properties(ctx, c.Reference(), []string{"environmentBrowser"}, &cr)
if err != nil {
return nil, err
}
if cr.EnvironmentBrowser == nil {
return nil, fmt.Errorf("%s: nil environmentBrowser", c.Reference())
}
return NewEnvironmentBrowser(c.c, *cr.EnvironmentBrowser), nil
}
func (c ComputeResource) ResourcePool(ctx context.Context) (*ResourcePool, error) {
var cr mo.ComputeResource

View file

@ -278,7 +278,10 @@ func (d Datastore) uploadTicket(ctx context.Context, path string, param *soap.Up
return nil, nil, err
}
p.Ticket = ticket
if ticket != nil {
p.Ticket = ticket
p.Close = true // disable Keep-Alive connection to ESX
}
return u, &p, nil
}
@ -294,7 +297,10 @@ func (d Datastore) downloadTicket(ctx context.Context, path string, param *soap.
return nil, nil, err
}
p.Ticket = ticket
if ticket != nil {
p.Ticket = ticket
p.Close = true // disable Keep-Alive connection to ESX
}
return u, &p, nil
}

View file

@ -0,0 +1,98 @@
/*
Copyright (c) 2023-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
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package object
import (
"context"
"github.com/vmware/govmomi/vim25"
"github.com/vmware/govmomi/vim25/methods"
"github.com/vmware/govmomi/vim25/types"
)
type EnvironmentBrowser struct {
Common
}
func NewEnvironmentBrowser(c *vim25.Client, ref types.ManagedObjectReference) *EnvironmentBrowser {
return &EnvironmentBrowser{
Common: NewCommon(c, ref),
}
}
func (b EnvironmentBrowser) QueryConfigTarget(ctx context.Context, host *HostSystem) (*types.ConfigTarget, error) {
req := types.QueryConfigTarget{
This: b.Reference(),
}
if host != nil {
ref := host.Reference()
req.Host = &ref
}
res, err := methods.QueryConfigTarget(ctx, b.Client(), &req)
if err != nil {
return nil, err
}
return res.Returnval, nil
}
func (b EnvironmentBrowser) QueryTargetCapabilities(ctx context.Context, host *HostSystem) (*types.HostCapability, error) {
req := types.QueryTargetCapabilities{
This: b.Reference(),
}
if host != nil {
ref := host.Reference()
req.Host = &ref
}
res, err := methods.QueryTargetCapabilities(ctx, b.Client(), &req)
if err != nil {
return nil, err
}
return res.Returnval, nil
}
func (b EnvironmentBrowser) QueryConfigOption(ctx context.Context, spec *types.EnvironmentBrowserConfigOptionQuerySpec) (*types.VirtualMachineConfigOption, error) {
req := types.QueryConfigOptionEx{
This: b.Reference(),
Spec: spec,
}
res, err := methods.QueryConfigOptionEx(ctx, b.Client(), &req)
if err != nil {
return nil, err
}
return res.Returnval, nil
}
func (b EnvironmentBrowser) QueryConfigOptionDescriptor(ctx context.Context) ([]types.VirtualMachineConfigOptionDescriptor, error) {
req := types.QueryConfigOptionDescriptor{
This: b.Reference(),
}
res, err := methods.QueryConfigOptionDescriptor(ctx, b.Client(), &req)
if err != nil {
return nil, err
}
return res.Returnval, nil
}

View file

@ -1,11 +1,11 @@
/*
Copyright (c) 2016 VMware, Inc. All Rights Reserved.
Copyright (c) 2016-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,
@ -36,10 +36,10 @@ import (
type HostCertificateInfo struct {
types.HostCertificateManagerCertificateInfo
ThumbprintSHA1 string
ThumbprintSHA256 string
ThumbprintSHA1 string `json:"thumbprintSHA1"`
ThumbprintSHA256 string `json:"thumbprintSHA256"`
Err error
Err error `json:"err"`
Certificate *x509.Certificate `json:"-"`
subjectName *pkix.Name

View file

@ -438,6 +438,17 @@ func (v VirtualMachine) Device(ctx context.Context) (VirtualDeviceList, error) {
return VirtualDeviceList(o.Config.Hardware.Device), nil
}
func (v VirtualMachine) EnvironmentBrowser(ctx context.Context) (*EnvironmentBrowser, error) {
var vm mo.VirtualMachine
err := v.Properties(ctx, v.Reference(), []string{"environmentBrowser"}, &vm)
if err != nil {
return nil, err
}
return NewEnvironmentBrowser(v.c, vm.EnvironmentBrowser), nil
}
func (v VirtualMachine) HostSystem(ctx context.Context) (*HostSystem, error) {
var o mo.VirtualMachine
@ -918,27 +929,6 @@ func (v VirtualMachine) Unregister(ctx context.Context) error {
return err
}
// QueryEnvironmentBrowser is a helper to get the environmentBrowser property.
func (v VirtualMachine) QueryConfigTarget(ctx context.Context) (*types.ConfigTarget, error) {
var vm mo.VirtualMachine
err := v.Properties(ctx, v.Reference(), []string{"environmentBrowser"}, &vm)
if err != nil {
return nil, err
}
req := types.QueryConfigTarget{
This: vm.EnvironmentBrowser,
}
res, err := methods.QueryConfigTarget(ctx, v.Client(), &req)
if err != nil {
return nil, err
}
return res.Returnval, nil
}
func (v VirtualMachine) MountToolsInstaller(ctx context.Context) error {
req := types.MountToolsInstaller{
This: v.Reference(),

View file

@ -79,10 +79,10 @@ type Client struct {
hostsMu sync.Mutex
hosts map[string]string
Namespace string // Vim namespace
Version string // Vim version
Types types.Func
UserAgent string
Namespace string `json:"namespace"` // Vim namespace
Version string `json:"version"` // Vim version
Types types.Func `json:"types"`
UserAgent string `json:"userAgent"`
cookie string
insecureCookies bool
@ -487,11 +487,11 @@ func (c *Client) URL() *url.URL {
}
type marshaledClient struct {
Cookies []*http.Cookie
URL *url.URL
Insecure bool
Version string
UseJSON bool
Cookies []*http.Cookie `json:"cookies"`
URL *url.URL `json:"url"`
Insecure bool `json:"insecure"`
Version string `json:"version"`
UseJSON bool `json:"useJSON"`
}
// MarshalJSON writes the Client configuration to JSON.
@ -727,6 +727,7 @@ type Upload struct {
Headers map[string]string
Ticket *http.Cookie
Progress progress.Sinker
Close bool
}
var DefaultUpload = Upload{
@ -754,7 +755,7 @@ func (c *Client) Upload(ctx context.Context, f io.Reader, u *url.URL, param *Upl
}
req = req.WithContext(ctx)
req.Close = param.Close
req.ContentLength = param.ContentLength
req.Header.Set("Content-Type", param.Type)
@ -812,6 +813,7 @@ type Download struct {
Ticket *http.Cookie
Progress progress.Sinker
Writer io.Writer
Close bool
}
var DefaultDownload = Download{
@ -826,6 +828,7 @@ func (c *Client) DownloadRequest(ctx context.Context, u *url.URL, param *Downloa
}
req = req.WithContext(ctx)
req.Close = param.Close
for k, v := range param.Headers {
req.Header.Add(k, v)