diff --git a/go.mod b/go.mod index f65b6337..1e048574 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/atc0005/go-nagios v0.19.0 github.com/google/go-cmp v0.6.0 github.com/rs/zerolog v1.33.0 - github.com/vmware/govmomi v0.46.2 + github.com/vmware/govmomi v0.46.3 ) require ( diff --git a/go.sum b/go.sum index de0de63a..c9348a33 100644 --- a/go.sum +++ b/go.sum @@ -22,8 +22,8 @@ github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/vmware/govmomi v0.46.2 h1:gZTIcKSr4sVcDB803FUv0r4lhOgE5Y5WQCNW75dPlls= -github.com/vmware/govmomi v0.46.2/go.mod h1:uoLVU9zlXC4p4GmLVG+ZJmBC0Gn3Q7mytOJvi39OhxA= +github.com/vmware/govmomi v0.46.3 h1:zBn42Rl0WZBFhGao8Dy0MFRkbE4YNPqOu0OBd+ww6VM= +github.com/vmware/govmomi v0.46.3/go.mod h1:uoLVU9zlXC4p4GmLVG+ZJmBC0Gn3Q7mytOJvi39OhxA= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/vendor/github.com/vmware/govmomi/internal/version/version.go b/vendor/github.com/vmware/govmomi/internal/version/version.go index e59a459a..fe355ec2 100644 --- a/vendor/github.com/vmware/govmomi/internal/version/version.go +++ b/vendor/github.com/vmware/govmomi/internal/version/version.go @@ -21,5 +21,5 @@ const ( ClientName = "govmomi" // ClientVersion is the version of this SDK - ClientVersion = "0.46.2" + ClientVersion = "0.46.3" ) diff --git a/vendor/github.com/vmware/govmomi/property/collector.go b/vendor/github.com/vmware/govmomi/property/collector.go index 9ee78d0d..244796df 100644 --- a/vendor/github.com/vmware/govmomi/property/collector.go +++ b/vendor/github.com/vmware/govmomi/property/collector.go @@ -264,9 +264,12 @@ func (p *Collector) RetrieveOne(ctx context.Context, obj types.ManagedObjectRefe // WaitForUpdatesEx waits for any of the specified properties of the specified // managed object to change. It calls the specified function for every update it -// receives. If this function returns false, it continues waiting for +// receives an update - including the empty filter set, which can occur if no +// objects are eligible for updates. +// +// If this function returns false, it continues waiting for // subsequent updates. If this function returns true, it stops waiting and -// returns. +// returns upon receiving the first non-empty filter set. // // If the Context is canceled, a call to CancelWaitForUpdates() is made and its // error value is returned. @@ -313,6 +316,12 @@ func (p *Collector) WaitForUpdatesEx( opts.Truncated = *set.Truncated } + if len(set.FilterSet) == 0 { + // Trigger callbacks in case callers need to be notified + // of the empty filter set. + _ = onUpdatesFn(make([]types.ObjectUpdate, 0)) + } + for _, fs := range set.FilterSet { if opts.PropagateMissing { for i := range fs.ObjectSet { diff --git a/vendor/github.com/vmware/govmomi/vim25/mo/type_info.go b/vendor/github.com/vmware/govmomi/vim25/mo/type_info.go index bb2d2e4a..cfe5e0af 100644 --- a/vendor/github.com/vmware/govmomi/vim25/mo/type_info.go +++ b/vendor/github.com/vmware/govmomi/vim25/mo/type_info.go @@ -341,8 +341,10 @@ func IsManagedObjectType(kind string) bool { func Value(ref types.ManagedObjectReference) (Reference, bool) { if rt, ok := t[ref.Type]; ok { val := reflect.New(rt) - val.Interface().(Entity).Entity().Self = ref - return val.Elem().Interface().(Reference), true + if e, ok := val.Interface().(Entity); ok { + e.Entity().Self = ref + return val.Elem().Interface().(Reference), true + } } return nil, false } diff --git a/vendor/github.com/vmware/govmomi/vim25/xml/marshal.go b/vendor/github.com/vmware/govmomi/vim25/xml/marshal.go index c0c0a588..2efdb7a4 100644 --- a/vendor/github.com/vmware/govmomi/vim25/xml/marshal.go +++ b/vendor/github.com/vmware/govmomi/vim25/xml/marshal.go @@ -497,11 +497,6 @@ func (p *printer) marshalValue(val reflect.Value, finfo *fieldInfo, startTemplat start.Name.Local = name } - // Add type attribute if necessary - if finfo != nil && finfo.flags&fTypeAttr != 0 { - start.Attr = append(start.Attr, Attr{xmlSchemaInstance, typeToString(typ)}) - } - // Attributes for i := range tinfo.fields { finfo := &tinfo.fields[i] @@ -524,6 +519,11 @@ func (p *printer) marshalValue(val reflect.Value, finfo *fieldInfo, startTemplat } } + // Add type attribute if necessary + if finfo != nil && finfo.flags&fTypeAttr != 0 { + start.Attr = append(start.Attr, Attr{xmlSchemaInstance, typeToString(typ)}) + } + if err := p.writeStart(&start); err != nil { return err } diff --git a/vendor/modules.txt b/vendor/modules.txt index 606922a2..c1d563fd 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -20,7 +20,7 @@ github.com/rs/zerolog github.com/rs/zerolog/internal/cbor github.com/rs/zerolog/internal/json github.com/rs/zerolog/log -# github.com/vmware/govmomi v0.46.2 +# github.com/vmware/govmomi v0.46.3 ## explicit; go 1.22 github.com/vmware/govmomi github.com/vmware/govmomi/fault