From 14fc1b05e2bdbd3622a87f1b269ea5a2c79c9330 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Oct 2024 11:42:00 +0000 Subject: [PATCH] Go Dependency: Bump github.com/vmware/govmomi from 0.43.0 to 0.44.1 Bumps [github.com/vmware/govmomi](https://github.com/vmware/govmomi) from 0.43.0 to 0.44.1. - [Release notes](https://github.com/vmware/govmomi/releases) - [Changelog](https://github.com/vmware/govmomi/blob/main/CHANGELOG.md) - [Commits](https://github.com/vmware/govmomi/compare/v0.43.0...v0.44.1) --- updated-dependencies: - dependency-name: github.com/vmware/govmomi dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 +- vendor/github.com/vmware/govmomi/.mailmap | 6 + vendor/github.com/vmware/govmomi/CHANGELOG.md | 555 ++++++++++++++++++ .../github.com/vmware/govmomi/CONTRIBUTING.md | 45 +- vendor/github.com/vmware/govmomi/CONTRIBUTORS | 17 + vendor/github.com/vmware/govmomi/README.md | 57 +- vendor/github.com/vmware/govmomi/USAGE.md | 0 .../github.com/vmware/govmomi/fault/fault.go | 315 ++++++++++ .../govmomi/internal/version/version.go | 2 +- .../github.com/vmware/govmomi/list/lister.go | 14 +- .../vmware/govmomi/object/datacenter.go | 7 +- .../vmware/govmomi/object/datastore.go | 36 +- .../object/host_certificate_manager.go | 8 +- .../vmware/govmomi/session/manager.go | 50 +- .../vmware/govmomi/vapi/rest/client.go | 36 +- .../vmware/govmomi/vim25/soap/client.go | 23 +- .../vmware/govmomi/vim25/soap/error.go | 46 +- .../vmware/govmomi/vim25/types/unreleased.go | 85 ++- vendor/modules.txt | 5 +- 20 files changed, 1131 insertions(+), 182 deletions(-) delete mode 100644 vendor/github.com/vmware/govmomi/USAGE.md create mode 100644 vendor/github.com/vmware/govmomi/fault/fault.go diff --git a/go.mod b/go.mod index c685c662..0fcc2e54 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/atc0005/go-nagios v0.16.1 github.com/google/go-cmp v0.6.0 github.com/rs/zerolog v1.33.0 - github.com/vmware/govmomi v0.43.0 + github.com/vmware/govmomi v0.44.1 ) require ( diff --git a/go.sum b/go.sum index fb0b9f05..c808fe6b 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.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/vmware/govmomi v0.43.0 h1:7Kg3Bkdly+TrE67BYXzRq7ZrDnn7xqpKX95uEh2f9Go= -github.com/vmware/govmomi v0.43.0/go.mod h1:IOv5nTXCPqH9qVJAlRuAGffogaLsNs8aF+e7vLgsHJU= +github.com/vmware/govmomi v0.44.1 h1:Hbt0nvVY8fnp3DGRJHngLflTos/uRrW54lhmJ/zKZFc= +github.com/vmware/govmomi v0.44.1/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/.mailmap b/vendor/github.com/vmware/govmomi/.mailmap index dd869e10..a0c1afcb 100644 --- a/vendor/github.com/vmware/govmomi/.mailmap +++ b/vendor/github.com/vmware/govmomi/.mailmap @@ -57,3 +57,9 @@ Yun Zhou <41678287+gh05tn0va@users.noreply.github.com> Zach G zach96guan Zach Tucker Zee Yang +Arunesh Pandey Arunesh Pandey +Eric Cao Eric Cao <32748317+ericvmw@users.noreply.github.com> +Eric Cao Eric Cao +Ryan Johnson Ryan Johnson +Stoyan Zhelyazkov Stoyan Zhelyazkov <156204153+spacegospod@users.noreply.github.com> +Yanlei Zhao Yanlei Zhao <136122252+yanleizhao-vmware@users.noreply.github.com> diff --git a/vendor/github.com/vmware/govmomi/CHANGELOG.md b/vendor/github.com/vmware/govmomi/CHANGELOG.md index 254f540f..3e7c2d44 100644 --- a/vendor/github.com/vmware/govmomi/CHANGELOG.md +++ b/vendor/github.com/vmware/govmomi/CHANGELOG.md @@ -1,4 +1,559 @@ + +## [Release v0.43.0](https://github.com/vmware/govmomi/compare/v0.42.0...v0.43.0) + +> Release Date: 2024-09-10 + +### 馃悶 Fix + +- [97aa7214] vcsim: avoid possible race when encoding PropertyCollector response +- [ad2d3573] use complete InventoryPath in Datacenter.Folders + +### 馃挮 API Changes + +- [476704a3] Fault helpers +- [caad54aa] add VirtualMachine.AddDeviceWithProfile method +- [a316da5c] VirtualMachine.AttachDisk unitNumber param is optional +- [8491321a] ToString for vim types +- [64610213] add namespace.RegisterVM binding +- [e602029e] Fix panic when encoding nil iface ptrs to JSON + +### 馃挮 `govc` (CLI) + +- [8fd86912] add disk.create '-profile' flag +- [ea3cf257] add vm.disk.create '-profile' flag +- [e73c34fa] add vm.disk.attach '-profile' flag +- [06dcf31a] Add '-size' flag to datastore.create +- [23390c23] add namespace.registervm command +- [1892eecd] Support thick/eager disk opts on vm.create + +### 馃挮 `vcsim` (Simulator) + +- [8421b678] Support PlaceVm with relocate placement type +- [9234233e] Support PlaceVm with reconfigure placement type +- [f06d0834] add VirtualMachine AttachDisk and DetachDisk methods +- [35dc193f] Support VM crypto spec in vC Sim +- [0517b87e] add namespace/registervm implementation + +### 馃Ч Chore + +- [b17abb20] Update version.go for v0.43.0 +- [93da4a20] sync generated govc/USAGE.md +- [51105db8] govc: add common StorageProfileFlag + +### 鈿狅笍 BREAKING + +VirtualMachine.AttachDisk unitNumber param is optional [a316da5c]: +switching from int32 to *int32, otherwise the client must choose a valid unitNumber. +vCenter will choose a unitNumber when not provided. + +### 馃摉 Commits + +- [b17abb20] chore: Update version.go for v0.43.0 +- [476704a3] api: Fault helpers +- [8421b678] vcsim: Support PlaceVm with relocate placement type +- [93b97e18] Update library state info to content library API +- [9234233e] vcsim: Support PlaceVm with reconfigure placement type +- [a2cbe108] build(deps): bump golang.org/x/text from 0.17.0 to 0.18.0 +- [93da4a20] chore: sync generated govc/USAGE.md +- [8fd86912] govc: add disk.create '-profile' flag +- [ea3cf257] govc: add vm.disk.create '-profile' flag +- [e73c34fa] govc: add vm.disk.attach '-profile' flag +- [51105db8] chore: govc: add common StorageProfileFlag +- [caad54aa] api: add VirtualMachine.AddDeviceWithProfile method +- [f06d0834] vcsim: add VirtualMachine AttachDisk and DetachDisk methods +- [97aa7214] fix: vcsim: avoid possible race when encoding PropertyCollector response +- [014a150b] build(deps): bump peter-evans/create-pull-request from 6 to 7 +- [35dc193f] vcsim: Support VM crypto spec in vC Sim +- [a56e33d3] Add BackingDiskPath to BackingObjectDetails +- [06dcf31a] govc: Add '-size' flag to datastore.create +- [f881d9b6] govc add disk.attach and disk.detach commands +- [a316da5c] api: VirtualMachine.AttachDisk unitNumber param is optional +- [8491321a] api: ToString for vim types +- [0517b87e] vcsim: add namespace/registervm implementation +- [23390c23] govc: add namespace.registervm command +- [64610213] api: add namespace.RegisterVM binding +- [e602029e] api: Fix panic when encoding nil iface ptrs to JSON +- [1892eecd] govc: Support thick/eager disk opts on vm.create +- [ad2d3573] fix: use complete InventoryPath in Datacenter.Folders + + +## [Release v0.42.0](https://github.com/vmware/govmomi/compare/v0.41.0...v0.42.0) + +> Release Date: 2024-08-16 + +### 馃挮 API Changes + +- [3fd16f78] update eam bindings to include authentication schema with eam-vcenter build 24075398 Closes: 3521 + +### 馃Ч Chore + +- [7a7c0646] Update version.go for v0.42.0 + +### 鈿狅笍 BREAKING + +### 馃摉 Commits + +- [7a7c0646] chore: Update version.go for v0.42.0 +- [3fd16f78] api: update eam bindings to include authentication schema with eam-vcenter build 24075398 Closes: 3521 + + +## [Release v0.41.0](https://github.com/vmware/govmomi/compare/v0.40.0...v0.41.0) + +> Release Date: 2024-08-16 + +### 馃挮 API Changes + +- [5a036494] OptionValues IsTrue|IsFalse + +### 馃Ч Chore + +- [a6cdbd4c] Update version.go for v0.41.0 + +### 鈿狅笍 BREAKING + +### 馃摉 Commits + +- [a6cdbd4c] chore: Update version.go for v0.41.0 +- [5a036494] api: OptionValues IsTrue|IsFalse + + +## [Release v0.40.0](https://github.com/vmware/govmomi/compare/v0.39.0...v0.40.0) + +> Release Date: 2024-08-12 + +### 馃悶 Fix + +- [15d5ffdb] govc object.collect truncation +- [18e43541] govc: output Message field for 'EventEx' types +- [11dc5a39] restore govc import.spec DiskProvisioning default value + +### 馃挕 Examples + +- [eea1d299] add ExampleCollector_WaitForUpdatesEx_pagination + +### 馃挮 API Changes + +- [d035dc72] add session.Manager.ImpersonateUser method +- [ea3e806f] add alarm package with helpers for AlarmManager and Alarms +- [208d532c] convert vSAN directory name to uuid in ResolveLibraryItemStorage + +### 馃挮 `govc` (CLI) + +- [0917e718] add session.login '-as' flag to impersonate user +- [d6a3b614] add alarm commands +- [2975ade1] add event.post command +- [db6e9623] add library.sync '-f' flag to force sync file content +- [cc02310c] add library.info -S flag + +### 馃挮 `vcsim` (Simulator) + +- [ee966a69] add SessionManager.ImpersonateUser method +- [5a501b50] implement WaitForUpdatesEx pagination support +- [9c282108] add AlarmManager +- [db40be6b] fix panic in CancelTask +- [e63f1272] add ovf DiskProvisioning validation +- [0633de5c] add DatastoreNamespaceManager + +### 馃Ч Chore + +- [6e27ff34] Update version.go for v0.40.0 + +### 鈿狅笍 BREAKING + +### 馃摉 Commits + +- [6e27ff34] chore: Update version.go for v0.40.0 +- [eea1d299] examples: add ExampleCollector_WaitForUpdatesEx_pagination +- [ee966a69] vcsim: add SessionManager.ImpersonateUser method +- [0917e718] govc: add session.login '-as' flag to impersonate user +- [d035dc72] api: add session.Manager.ImpersonateUser method +- [15d5ffdb] fix: govc object.collect truncation +- [5a501b50] vcsim: implement WaitForUpdatesEx pagination support +- [9c282108] vcsim: add AlarmManager +- [d6a3b614] govc: add alarm commands +- [ea3e806f] api: add alarm package with helpers for AlarmManager and Alarms +- [2975ade1] govc: add event.post command +- [18e43541] fix: govc: output Message field for 'EventEx' types +- [6f998780] build(deps): bump golang.org/x/text from 0.16.0 to 0.17.0 +- [db40be6b] vcsim: fix panic in CancelTask +- [db6e9623] govc: add library.sync '-f' flag to force sync file content +- [11dc5a39] fix: restore govc import.spec DiskProvisioning default value +- [e63f1272] vcsim: add ovf DiskProvisioning validation +- [208d532c] api: convert vSAN directory name to uuid in ResolveLibraryItemStorage +- [0633de5c] vcsim: add DatastoreNamespaceManager +- [cc02310c] govc: add library.info -S flag +- [0d6a605c] review feedback +- [2957bedf] review feedback +- [8e509dfb] implement capacityAllocationUnits parser + + +## [Release v0.39.0](https://github.com/vmware/govmomi/compare/v0.38.0...v0.39.0) + +> Release Date: 2024-07-22 + +### 馃悶 Fix + +- [1bc3a4a4] handle base types by default in mo.LoadObjectContent + +### 馃挮 API Changes + +- [5c0af375] use CheckTestType in compat and provisioning checkers +- [2e77836c] add sata controller +- [bdb034ee] Exporting Unit field in MetricSeries struct for external use +- [78f07c63] Add simulator test for GetVirtualDiskInfoByUUID +- [2d16e19f] GetVirtualDiskInfoByUUID for getting capacity/size info +- [29b1bce9] change CoresPerNumaNode to a pointer type +- [3139de32] Add a method for extending VMDK +- [6096c0d4] add ResolveLibraryItemStorage + +### 馃挮 `govc` (CLI) + +- [04fe4c26] add vm.check commands +- [976bca3b] add '-spec' flag to vm clone, migrate and create commands +- [d92015c4] add vm.migrate -net flag + +### 馃挮 `vcsim` (Simulator) + +- [eb2e1ea1] add VmCompatibilityChecker and VmProvisioningChecker +- [a463e543] Add support for DRS automation levels +- [f7a85a81] Re-enable TenantManager + +### 馃Ч Chore + +- [590c92b1] Update version.go for v0.39.0 +- [4434e26b] bump go version +- [d7e27099] fix codeql ([#3492](https://github.com/vmware/govmomi/issues/3492)) +- [fb6e5977] fix codeql + +### 鈿狅笍 BREAKING + +### 馃摉 Commits + +- [590c92b1] chore: Update version.go for v0.39.0 +- [5c0af375] api: use CheckTestType in compat and provisioning checkers +- [2e77836c] api: add sata controller +- [bdb034ee] api: Exporting Unit field in MetricSeries struct for external use +- [4434e26b] chore: bump go version +- [04fe4c26] govc: add vm.check commands +- [976bca3b] govc: add '-spec' flag to vm clone, migrate and create commands +- [d92015c4] govc: add vm.migrate -net flag +- [eb2e1ea1] vcsim: add VmCompatibilityChecker and VmProvisioningChecker +- [12467b00] refactor: make importing templates available as a lib +- [d7e27099] chore: fix codeql ([#3492](https://github.com/vmware/govmomi/issues/3492)) +- [fb6e5977] chore: fix codeql +- [a463e543] vcsim: Add support for DRS automation levels +- [78f07c63] api: Add simulator test for GetVirtualDiskInfoByUUID +- [2d16e19f] api: GetVirtualDiskInfoByUUID for getting capacity/size info +- [29b1bce9] api: change CoresPerNumaNode to a pointer type +- [3139de32] api: Add a method for extending VMDK +- [6096c0d4] api: add ResolveLibraryItemStorage +- [1bc3a4a4] fix: handle base types by default in mo.LoadObjectContent +- [f7a85a81] vcsim: Re-enable TenantManager + + +## [Release v0.38.0](https://github.com/vmware/govmomi/compare/v0.37.3...v0.38.0) + +> Release Date: 2024-06-24 + +### 馃悶 Fix + +- [22607cd8] xml marshal byte array fields as vCenter does +- [298cfbf3] govc vm.disk.change should only modify CapacityInBytes + +### 馃挮 API Changes + +- [0de9553a] EnsureDisksHaveControllers helper +- [3d70ab5c] OptionValueList helper +- [d80136a5] add storage_specs field to Namespace related structures +- [748043cd] add pbm.DatastoreMap for finding compatible Datastores +- [fc2a6b12] HardwareVersion.IsSupported vs IsValid +- [a68c21f2] Add library item storage APIs +- [7d1be3e7] Update ConfigInfoToConfigSpec +- [12ab4099] Update generated types +- [45aa2e92] add checksum validation in Content Library update session file API +- [7a00a0b4] Generate enum consts with Values funcs +- [f2852e39] add SSLCertificate to TransferEndpoint in content library API + +### 馃挮 `govc` (CLI) + +- [c3c5ffba] add vsan.info -file-service-enabled flag +- [a916df4e] add host.tpm.info and host.tpm.report commands +- [7f0c9f0c] add host.cert.info -show flag +- [ae316d65] add storage.policy.create zonal option +- [3e648db2] add '-storage' flag to namespace.create and namespace.update commands +- [e7d54f90] add vm.create '-profile' and '-place' flags +- [5677b0e5] Add feature to pass fullname and org for windows vm customization + +### 馃挮 `vcsim` (Simulator) + +- [e9f4cb73] add vSAN FileServiceConfig support +- [072011c6] add HostCertificateManager +- [a0bbbf3f] add library item storage API support +- [3b7ff25f] add PropertyCollector index support +- [651f7d27] fix: ignore unknown refs in Datacenter.PowerOnMultiVM +- [7251db75] Add PbmCheckCompatibility method in pbm simulator +- [542398a2] add HostVirtualNicManager +- [0be5fec8] fix ReconfigVM validation when changing disk size + +### 馃Ч Chore + +- [51648874] Update version.go for v0.38.0 +- [43510fbc] make doc +- [36631314] govc: use generated enum lists + +### 鈿狅笍 BREAKING + +HardwareVersion.IsSupported vs IsValid [fc2a6b12]: +HardwareVersion.IsValid is more relaxed, consider IsSupported +* HardwareVersion.IsValid returns true if the specified value + matches a VMX version format. +* HardwareVersion.IsSupported behaves how IsValid used to behave. + +### 馃摉 Commits + +- [51648874] chore: Update version.go for v0.38.0 +- [c3c5ffba] govc: add vsan.info -file-service-enabled flag +- [e9f4cb73] vcsim: add vSAN FileServiceConfig support +- [43510fbc] chore: make doc +- [a916df4e] govc: add host.tpm.info and host.tpm.report commands +- [072011c6] vcsim: add HostCertificateManager +- [7f0c9f0c] govc: add host.cert.info -show flag +- [22607cd8] fix: xml marshal byte array fields as vCenter does +- [ae316d65] govc: add storage.policy.create zonal option +- [0de9553a] api: EnsureDisksHaveControllers helper +- [3d70ab5c] api: OptionValueList helper +- [3e648db2] govc: add '-storage' flag to namespace.create and namespace.update commands +- [d80136a5] api: add storage_specs field to Namespace related structures +- [e7d54f90] govc: add vm.create '-profile' and '-place' flags +- [748043cd] api: add pbm.DatastoreMap for finding compatible Datastores +- [5677b0e5] govc: Add feature to pass fullname and org for windows vm customization +- [298cfbf3] fix: govc vm.disk.change should only modify CapacityInBytes +- [ee49793c] build(deps): bump goreleaser/goreleaser-action from 5 to 6 +- [a0bbbf3f] vcsim: add library item storage API support +- [1ec975ca] nfc: Record the SSL thumbprint for the host the (device) URL refers to +- [3b7ff25f] vcsim: add PropertyCollector index support +- [651f7d27] vcsim: fix: ignore unknown refs in Datacenter.PowerOnMultiVM +- [fc2a6b12] api: HardwareVersion.IsSupported vs IsValid +- [1edfbe3b] feat: vSphere Zones API bindings +- [a68c21f2] api: Add library item storage APIs +- [b20c733e] build(deps): bump nokogiri from 1.16.2 to 1.16.5 in /gen +- [7d1be3e7] api: Update ConfigInfoToConfigSpec +- [12ab4099] api: Update generated types +- [7251db75] vcsim: Add PbmCheckCompatibility method in pbm simulator +- [45aa2e92] api: add checksum validation in Content Library update session file API +- [542398a2] vcsim: add HostVirtualNicManager +- [36631314] chore: govc: use generated enum lists +- [7a00a0b4] api: Generate enum consts with Values funcs +- [0be5fec8] vcsim: fix ReconfigVM validation when changing disk size +- [f2852e39] api: add SSLCertificate to TransferEndpoint in content library API +- [12f8babe] build(deps): bump chuhlomin/render-template from 1.9 to 1.10 +- [0893552e] bugfix: Exclude ServerGUID from MOR comparison in WaitEx + + +## [Release v0.37.3](https://github.com/vmware/govmomi/compare/v0.37.2...v0.37.3) + +> Release Date: 2024-06-05 + +### 馃Ч Chore + +- [6b391d35] Update version.go for v0.37.3 + +### 鈿狅笍 BREAKING + +### 馃摉 Commits + +- [6b391d35] chore: Update version.go for v0.37.3 +- [a554e040] nfc: Record the SSL thumbprint for the host the (device) URL refers to + + +## [Release v0.37.2](https://github.com/vmware/govmomi/compare/v0.37.1...v0.37.2) + +> Release Date: 2024-05-09 + +### 馃挮 API Changes + +- [37269b6a] add checksum validation in Content Library update session file API +- [ce7ef70a] add SSLCertificate to TransferEndpoint in content library API + +### 馃挮 `vcsim` (Simulator) + +- [6a0d7e7d] Add PbmCheckCompatibility method in pbm simulator +- [e6fe159b] fix ReconfigVM validation when changing disk size + +### 馃Ч Chore + +- [9a1b3c8f] Update version.go for v0.37.2 + +### 鈿狅笍 BREAKING + +### 馃摉 Commits + +- [9a1b3c8f] chore: Update version.go for v0.37.2 +- [6a0d7e7d] vcsim: Add PbmCheckCompatibility method in pbm simulator +- [37269b6a] api: add checksum validation in Content Library update session file API +- [e6fe159b] vcsim: fix ReconfigVM validation when changing disk size +- [ce7ef70a] api: add SSLCertificate to TransferEndpoint in content library API + + +## [Release v0.37.1](https://github.com/vmware/govmomi/compare/v0.37.0...v0.37.1) + +> Release Date: 2024-04-18 + +### 馃Ч Chore + +- [bf28314d] Update version.go for v0.37.1 + +### 鈿狅笍 BREAKING + +### 馃摉 Commits + +- [bf28314d] chore: Update version.go for v0.37.1 +- [8c99cb85] bugfix: Exclude ServerGUID from MOR comparison in WaitEx + + +## [Release v0.37.0](https://github.com/vmware/govmomi/compare/v0.36.3...v0.37.0) + +> Release Date: 2024-04-12 + +### 馃悶 Fix + +- [095f926b] make cns.Client independent of vim25.Client +- [dcf063cd] vcsim: re-parent children in ResourcePool.Destroy +- [7455935a] endpoint url to bypass lookup service if envoy sidecar enabled +- [83754772] lookup client to use envoy sidecar url if enabled + +### 馃挮 API Changes + +- [f5080d3e] use RetrievePropertiesEx in mo package functions +- [a0a8257a] change RetrieveProperties to collect results in batches +- [367c55fe] move vim25.Client.UseServiceVersion to soap.Client +- [f6710489] Expose vSphere API to evict subscribed content library +- [3784b2f2] Add Downloadendpoint field in the library item file struct + +### 馃挮 `govc` (CLI) + +- [9285e441] Add library.evict command +- [fc20e24d] add default output formatting for namespace commands +- [27824cf5] snapshot.tree json output to stdout + +### 馃挮 `vcsim` (Simulator) + +- [70a7617d] toggle Content Library cached fields in sync and evict calls +- [cf719441] add ExtensionManager.FindExtension method +- [4348bd9f] RetrievePropertiesEx & ContinueRetrievePropertiesEx +- [4cec0597] add TaskHistoryCollector support +- [9c59e9c5] add TaskManager.CreateTask support +- [d9af2a26] add ExtensionManager support + +### 馃搩 Documentation + +- [368d194a] update CHANGELOG +- [2bbe81af] update CONTRIBUTORS + +### 馃Ч Chore + +- [134152d4] Update version.go for v0.37.0 + +### 鈿狅笍 BREAKING + +### 馃摉 Commits + +- [134152d4] chore: Update version.go for v0.37.0 +- [70a7617d] vcsim: toggle Content Library cached fields in sync and evict calls +- [9285e441] govc: Add library.evict command +- [cf719441] vcsim: add ExtensionManager.FindExtension method +- [92a29ebf] build(deps): add vcsim to rpm +- [fc20e24d] govc: add default output formatting for namespace commands +- [095f926b] fix: make cns.Client independent of vim25.Client +- [f5080d3e] api: use RetrievePropertiesEx in mo package functions +- [4348bd9f] vcsim: RetrievePropertiesEx & ContinueRetrievePropertiesEx +- [a0a8257a] api: change RetrieveProperties to collect results in batches +- [8a618f77] feat: Add VAPI bindings for guest namespaces and virtual machine classes +- [e66065ab] build(deps): enable rpm builds and add archs +- [367c55fe] api: move vim25.Client.UseServiceVersion to soap.Client +- [f6710489] api: Expose vSphere API to evict subscribed content library +- [dcf063cd] fix: vcsim: re-parent children in ResourcePool.Destroy +- [4cec0597] vcsim: add TaskHistoryCollector support +- [041fd59a] Remove deprecation for task.Wait and task.WaitForResult +- [27824cf5] govc: snapshot.tree json output to stdout +- [7455935a] fix: endpoint url to bypass lookup service if envoy sidecar enabled +- [3784b2f2] api: Add Downloadendpoint field in the library item file struct +- [9c59e9c5] vcsim: add TaskManager.CreateTask support +- [d9af2a26] vcsim: add ExtensionManager support +- [e0ab2da2] build(deps): bump google.golang.org/protobuf in /hack/tools +- [8bfb252c] Add support for SHA256 thumbprint based vCenter authentication +- [83754772] fix: lookup client to use envoy sidecar url if enabled +- [368d194a] docs: update CHANGELOG +- [2bbe81af] docs: update CONTRIBUTORS + + +## [Release v0.36.3](https://github.com/vmware/govmomi/compare/v0.36.2...v0.36.3) + +> Release Date: 2024-04-02 + +### 馃Ч Chore + +- [35df9f35] Update version.go for v0.36.3 + +### 鈿狅笍 BREAKING + +### 馃摉 Commits + +- [35df9f35] chore: Update version.go for v0.36.3 +- [47c5ff94] Remove deprecation for task.Wait and task.WaitForResult + + +## [Release v0.36.2](https://github.com/vmware/govmomi/compare/v0.36.1...v0.36.2) + +> Release Date: 2024-03-27 + +### 馃悶 Fix + +- [9c5fca64] endpoint url to bypass lookup service if envoy sidecar enabled + +### 馃挮 API Changes + +- [f9e1a48e] Add Downloadendpoint field in the library item file struct + +### 馃挮 `govc` (CLI) + +- [cd9ce0ae] snapshot.tree json output to stdout + +### 馃Ч Chore + +- [f2a87d75] Update version.go for v0.36.2 + +### 鈿狅笍 BREAKING + +### 馃摉 Commits + +- [f2a87d75] chore: Update version.go for v0.36.2 +- [cd9ce0ae] govc: snapshot.tree json output to stdout +- [9c5fca64] fix: endpoint url to bypass lookup service if envoy sidecar enabled +- [f9e1a48e] api: Add Downloadendpoint field in the library item file struct + + +## [Release v0.36.1](https://github.com/vmware/govmomi/compare/v0.36.0...v0.36.1) + +> Release Date: 2024-03-12 + +### 馃悶 Fix + +- [edf70dc3] lookup client to use envoy sidecar url if enabled + +### 馃Ч Chore + +- [cc533e4b] Update version.go for v0.36.1 + +### 鈿狅笍 BREAKING + +### 馃摉 Commits + +- [cc533e4b] chore: Update version.go for v0.36.1 +- [27996347] Add support for SHA256 thumbprint based vCenter authentication +- [edf70dc3] fix: lookup client to use envoy sidecar url if enabled + ## [Release v0.36.0](https://github.com/vmware/govmomi/compare/v0.35.0...v0.36.0) diff --git a/vendor/github.com/vmware/govmomi/CONTRIBUTING.md b/vendor/github.com/vmware/govmomi/CONTRIBUTING.md index 038e5321..7166d606 100644 --- a/vendor/github.com/vmware/govmomi/CONTRIBUTING.md +++ b/vendor/github.com/vmware/govmomi/CONTRIBUTING.md @@ -1,5 +1,11 @@ # Contributing to `govmomi` +tl;dr + +- Sign your commits, unless you've signed the CLA +- Include a component `prefix:` in your commit message, if applicable +- Squash fixup commits and force push to your branch + ## Getting started First, fork the repository on GitHub to your personal account. @@ -27,6 +33,7 @@ This is a rough outline of what a contributor's workflow looks like: - Create an issue describing the feature/fix - Create a topic branch from where you want to base your work. - Make commits of logical units. +- [Sign](#sign-off-your-work) your commits. - Make sure your commit messages are in the proper format (see below). - Push your changes to a topic branch in your fork of the repository. - Submit a pull request to `vmware/govmomi`. @@ -38,12 +45,30 @@ and **supported prefixes**, e.g. `govc: `. > my!](https://www.mgasch.com/2021/05/git-basics/) for more details on how to > successfully contribute to an open source project. +### Sign-off Your Work + +Use the [Developer Certificate of Origin](https://developercertificate.org/) (DCO) on all Pull Requests. +By adding this line to their commit messages, contributors *sign-off* that they adhere to the requirements of the DCO. + +Git provides the `-s` command-line option to append the required line +automatically to the commit message: + +```bash +git commit -s -m 'This is my commit message' +``` + +For an existing commit, you can also use this option with `--amend`: + +```bash +git commit -s --amend +``` + ### Example 1 - Fix a Bug in `govmomi` ```bash git checkout -b issue- main git add -git commit -m "fix: ..." -m "Closes: #" +git commit -s -m "fix: ..." -m "Closes: #" git push $USER issue- ``` @@ -52,7 +77,7 @@ git push $USER issue- ```bash git checkout -b issue- main git add -git commit -m "Add API ..." -m "Closes: #" +git commit -s -m "Add API ..." -m "Closes: #" git push $USER issue- ``` @@ -61,10 +86,10 @@ git push $USER issue- ```bash git checkout -b issue- main git add -git commit -m "govc: Add feature ..." -m "Closes: #" +git commit -s -m "govc: Add feature ..." -m "Closes: #" git push $USER issue- ``` -**Note**: +**Note**: To register the new `govc` command package, add a blank `_` import to `govmomi/govc/main.go`. ### Example 4 - Fix a Bug in `vcsim` @@ -72,7 +97,7 @@ To register the new `govc` command package, add a blank `_` import to `govmomi/g ```bash git checkout -b issue- main git add -git commit -m "vcsim: Fix ..." -m "Closes: #" +git commit -s -m "vcsim: Fix ..." -m "Closes: #" git push $USER issue- ``` @@ -80,7 +105,7 @@ git push $USER issue- Breaking changes, e.g. to the `govmomi` APIs, are highlighted in the `CHANGELOG` and release notes when the keyword `BREAKING:` is used in the commit message -body. +body. The text after `BREAKING:` is used in the corresponding highlighted section. Thus these details should be stated at the body of the commit message. @@ -89,7 +114,7 @@ Multi-line strings are supported. ```bash git checkout -b issue- main git add -cat << EOF | git commit -F - +cat << EOF | git commit -s -F - Add ctx to funcXYZ This commit introduces context.Context to function XYZ @@ -127,7 +152,7 @@ directly instead. git add . # create a fixup commit which will be merged into your (original) -git commit --fixup +git commit -s --fixup git push $USER issue- ``` @@ -162,7 +187,7 @@ e.g. `Closes: #`. The [`CHANGELOG.md`](./CHANGELOG.md) and release page uses **commit message prefixes** for grouping and highlighting. A commit message that starts with `[prefix:] ` will place this commit under the respective -section in the `CHANGELOG`. +section in the `CHANGELOG`. The following example creates a commit referencing the `issue: 1234` and puts the commit message in the `govc` `CHANGELOG` section: @@ -186,7 +211,7 @@ is recommended to break up your commits using distinct prefixes. ### Running CI Checks and Tests You can run both `make check` and `make test` from the top level of the -repository. +repository. While `make check` will catch formatting and import errors, it will not apply any fixes. The developer is expected to do that. diff --git a/vendor/github.com/vmware/govmomi/CONTRIBUTORS b/vendor/github.com/vmware/govmomi/CONTRIBUTORS index 03ca7c2f..7d132852 100644 --- a/vendor/github.com/vmware/govmomi/CONTRIBUTORS +++ b/vendor/github.com/vmware/govmomi/CONTRIBUTORS @@ -8,6 +8,7 @@ abrarshivani Adam Chalkley Adam Fowler Adam Shannon +Adnan Baruni Akanksha Panse Al Biheiri Alessandro Cortiana @@ -24,6 +25,7 @@ Andrew Andrew Chin Andrew Kutz Andrey Klimentyev +aneesurrehman001 <55150455+aneesurrehman001@users.noreply.github.com> Anfernee Yongkun Gui angystardust aniketGslab @@ -32,6 +34,7 @@ Ankit Vaidya Ankur Huralikoppi Anna Carrigan Antony Saba +Anusha Ramineni Ariel Chinn Arran Walker Artem Anisimov @@ -46,6 +49,7 @@ Ben Vickers Benjamin Davini Benjamin Peterson Benjamin Vickers +Bernd Zeimetz Bhavya Choudhary Bob Killen Brad Fitzpatrick @@ -57,6 +61,7 @@ Bruno Meneguello <1322552+bkmeneguello@users.noreply.github.com> Bryan Venteicher C S P Nanda Carsten Grohmann +Chebrolu Cheng Cheng Chethan Venkatesh Choudhury Sarada Prasanna Nanda @@ -82,6 +87,7 @@ Davide Agnello Davinder Kumar Defa demarey +Derek Beard Deric Crago Deyan Popov Dinesh Bhat <35480850+dbhat-arkin@users.noreply.github.com> @@ -92,12 +98,14 @@ Doug MacEachern East <60801291+houfangdong@users.noreply.github.com> Eloy Coto Eng Zer Jun +Eric Cao Eric Edens Eric Graham <16710890+Pheric@users.noreply.github.com> Eric Gray Eric Yutao Erik Hollensbe Erik Lund +Erim Erdal Essodjolo KAHANAM Ethan Kaley Evan Chu @@ -121,6 +129,7 @@ Hasan Mahmood Haydon Ryan Heiko Reese Henrik Hodne +Himanshu Ranjan hkumar Hrabur Stoyanov hui luo @@ -135,10 +144,12 @@ Jeremy Canady jeremy-clerc Jiatong Wang jingyizPensando +jitinkumar94 Jonas Ausevicius Jorge Sevilla Joseph LeBlanc Jo茫o Pereira +Jukka Lehtniemi Julien PILLON Justin J. Novack kayrus @@ -155,6 +166,7 @@ Liping Xue liron.levin Louie Jiang Lubron Zhan +Luis Davim Luther Monson Madanagopal Arunachalam makelarisjr <8687447+makelarisjr@users.noreply.github.com> @@ -209,16 +221,19 @@ Robin Watkins Rowan Jacobs Roy Ling rsikdar +rubinthomasdev runner.mei Ryan Johnson S R Ashrith S.脟a臒lar Onur Saad Malik +Sai Diliyaer Sam Zhu samzhu333 <45263849+samzhu333@users.noreply.github.com> Sandeep Pissay Srinivasa Rao schmikei Scott Holden +Sebastian Mitterle Sergey Ignatov serokles shahra @@ -229,6 +244,7 @@ shylasrinivas sky-joker smaftoul smahadik +Sreeja Acharya Sten Feldman Stepan Mazurov Steve Purcell @@ -264,6 +280,7 @@ xing-yang xinyanw409 Yang Yang yangxi +Yanlei Zhao Yann Hodique Yash Nitin Desai Yassine TIJANI diff --git a/vendor/github.com/vmware/govmomi/README.md b/vendor/github.com/vmware/govmomi/README.md index 13ba3bf3..070714d0 100644 --- a/vendor/github.com/vmware/govmomi/README.md +++ b/vendor/github.com/vmware/govmomi/README.md @@ -19,9 +19,7 @@ In addition to the vSphere API client, this repository includes: ## Compatibility -This library supports vCenter Server and ESXi versions following the [VMware Product Lifecycle Matrix][reference-lifecycle]. - -Product versions that are end of support may work, but are not officially supported. +vSphere 7.0 and higher. ## Documentation @@ -37,10 +35,7 @@ Installation instructions, released binaries, and Docker images are documented i ## Discussion -The project encourages the community to collaborate using GitHub [issues][govmomi-github-issues], GitHub [discussions][govmomi-github-discussions], and [Slack][slack-channel]. - -> **Note** -> Access to Slack requires a free [VMware {code}][slack-join] developer program membership. +Collaborate with the community using GitHub [discussions][govmomi-github-discussions] and GitHub [issues][govmomi-github-issues]. ## Status @@ -48,29 +43,8 @@ Changes to the API are subject to [semantic versioning][reference-semver]. Refer to the [CHANGELOG][govmomi-changelog] for version to version changes. -## Notable Projects Using govmomi - -* [collectd-vsphere][project-travisci-collectd-vsphere] -* [Docker LinuxKit][project-docker-linuxKit] -* [Elastic Agent VMware vSphere integration][project-elastic-agent] -* [Gru][project-gru] -* [Juju][project-juju] -* [Jupiter Brain][project-travisci-jupiter-brain] -* [Kubernetes vSphere Cloud Provider][project-k8s-cloud-provider] -* [Kubernetes Cluster API][project-k8s-cluster-api] -* [OPS][project-nanovms-ops] -* [OpenTelemetry Collector Contrib][opentelemetry-collector-contrib] -* [Packer Plugin for VMware vSphere][project-hashicorp-packer-plugin-vsphere] -* [Rancher][project-rancher] -* [Terraform Provider for VMware vSphere][project-hashicorp-terraform-provider-vsphere] -* [Telegraf][project-influxdata-telegraf] -* [VMware Event Broker Appliance][project-vmware-veba] -* [VMware vSphere Integrated Containers Engine][project-vmware-vic] -* [VMware vSphere 7.0][project-vmware-vsphere] - ## Related Projects -* [go-vmware-nsxt][reference-go-vmware-nsxt] * [pyvmomi][reference-pyvmomi] * [rbvmomi][reference-rbvmomi] @@ -80,7 +54,7 @@ govmomi is available under the [Apache 2 License][govmomi-license]. ## Name -Pronounced: _go路鈥媣路鈥媘om路鈥媔e_ +Pronounced: _go路鈥媣路鈥媘om路鈥媏_ Follows pyvmomi and rbvmomi: language prefix + the vSphere acronym "VM Object Management Infrastructure". @@ -97,31 +71,10 @@ Follows pyvmomi and rbvmomi: language prefix + the vSphere acronym "VM Object Ma [go-reference]: https://pkg.go.dev/github.com/vmware/govmomi [go-report-card]: https://goreportcard.com/report/github.com/vmware/govmomi [go-version]: https://github.com/vmware/govmomi -[opentelemetry-collector-contrib]: https://github.com/open-telemetry/opentelemetry-collector-contrib -[project-docker-linuxKit]: https://github.com/linuxkit/linuxkit/tree/master/src/cmd/linuxkit -[project-elastic-agent]: https://github.com/elastic/integrations/tree/main/packages/vsphere -[project-gru]: https://github.com/dnaeon/gru -[project-hashicorp-packer-plugin-vsphere]: https://github.com/hashicorp/packer-plugin-vsphere -[project-hashicorp-terraform-provider-vsphere]: https://github.com/hashicorp/terraform-provider-vsphere -[project-influxdata-telegraf]: https://github.com/influxdata/telegraf/tree/master/plugins/inputs/vsphere -[project-juju]: https://github.com/juju/juju -[project-k8s-cloud-provider]: https://github.com/kubernetes/cloud-provider-vsphere -[project-k8s-cluster-api]: https://github.com/kubernetes-sigs/cluster-api-provider-vsphere -[project-nanovms-ops]: https://github.com/nanovms/ops -[project-rancher]: https://github.com/rancher/rancher/blob/master/pkg/api/norman/customization/vsphere/listers.go -[project-travisci-collectd-vsphere]: https://github.com/travis-ci/collectd-vsphere -[project-travisci-jupiter-brain]: https://github.com/travis-ci/jupiter-brain -[project-vmware-veba]: https://github.com/vmware-samples/vcenter-event-broker-appliance/tree/development/vmware-event-router -[project-vmware-vic]: https://github.com/vmware/vic -[project-vmware-vsphere]: https://docs.vmware.com/en/VMware-vSphere/7.0/rn/vsphere-esxi-vcenter-server-7-vsphere-with-kubernetes-release-notes.html -[reference-api]: https://developer.vmware.com/apis/968/vsphere -[reference-godoc]: http://godoc.org/github.com/vmware/govmomi -[reference-go-vmware-nsxt]: https://github.com/vmware/go-vmware-nsxt -[reference-lifecycle]: https://lifecycle.vmware.com +[reference-api]: https://developer.broadcom.com/xapis/vsphere-web-services-api/latest/ +[reference-godoc]: https://pkg.go.dev/github.com/vmware/govmomi [reference-pyvmomi]: https://github.com/vmware/pyvmomi [reference-rbvmomi]: https://github.com/vmware/rbvmomi [reference-semver]: http://semver.org -[slack-join]: https://developer.vmware.com/join/ -[slack-channel]: https://vmwarecode.slack.com/messages/govmomi [toolbox]: toolbox/README.md [vcsim]: vcsim/README.md diff --git a/vendor/github.com/vmware/govmomi/USAGE.md b/vendor/github.com/vmware/govmomi/USAGE.md deleted file mode 100644 index e69de29b..00000000 diff --git a/vendor/github.com/vmware/govmomi/fault/fault.go b/vendor/github.com/vmware/govmomi/fault/fault.go new file mode 100644 index 00000000..e16478ee --- /dev/null +++ b/vendor/github.com/vmware/govmomi/fault/fault.go @@ -0,0 +1,315 @@ +/* +Copyright (c) 2024-2024 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 fault + +import ( + "reflect" + + "github.com/vmware/govmomi/vim25/types" +) + +// As finds the first fault in the error's tree that matches target, and if one +// is found, sets the target to that fault value and returns the fault's +// localized message and true. Otherwise, false is returned. +// +// The tree is inspected according to the object type. If the object implements +// Golang's error interface, the Unwrap() error or Unwrap() []error methods are +// repeatedly checked for additional errors. If the object implements GoVmomi's +// BaseMethodFault or HasLocalizedMethodFault interfaces, the object is checked +// for an underlying FaultCause. When err wraps multiple errors or faults, err +// is examined followed by a depth-first traversal of its children. +// +// An error matches target if the error's concrete value is assignable to the +// value pointed to by target, or if the error has a method +// AsFault(BaseMethodFault) (string, bool) such that AsFault(BaseMethodFault) +// returns true. In the latter case, the AsFault method is responsible for +// setting target. +// +// An error type might provide an AsFault method so it can be treated as if it +// were a different error type. +// +// This function panics if err does not implement error, types.BaseMethodFault, +// types.HasLocalizedMethodFault, Fault() types.BaseMethodFault, or if target is +// not a pointer. +func As(err, target any) (localizedMessage string, okay bool) { + if err == nil { + return + } + if target == nil { + panic("fault: target cannot be nil") + } + val := reflect.ValueOf(target) + typ := val.Type() + if typ.Kind() != reflect.Ptr || val.IsNil() { + panic("fault: target must be a non-nil pointer") + } + targetType := typ.Elem() + if targetType.Kind() != reflect.Interface && + !targetType.Implements(baseMethodFaultType) { + panic("fault: *target must be interface or implement BaseMethodFault") + } + if !as(err, target, val, targetType, &localizedMessage) { + return "", false + } + return localizedMessage, true +} + +func as( + err, + target any, + targetVal reflect.Value, + targetType reflect.Type, + localizedMsg *string) bool { + + for { + if reflect.TypeOf(err).AssignableTo(targetType) { + targetVal.Elem().Set(reflect.ValueOf(err)) + return true + } + if tErr, ok := err.(hasAsFault); ok { + if msg, ok := tErr.AsFault(target); ok { + *localizedMsg = msg + return true + } + return false + } + switch tErr := err.(type) { + case types.HasLocalizedMethodFault: + if fault := tErr.GetLocalizedMethodFault(); fault != nil { + *localizedMsg = fault.LocalizedMessage + if fault.Fault != nil { + return as( + fault.Fault, + target, + targetVal, + targetType, + localizedMsg) + } + } + return false + case types.BaseMethodFault: + if fault := tErr.GetMethodFault(); fault != nil { + if fault.FaultCause != nil { + *localizedMsg = fault.FaultCause.LocalizedMessage + return as( + fault.FaultCause, + target, + targetVal, + targetType, + localizedMsg) + } + } + return false + case hasFault: + if fault := tErr.Fault(); fault != nil { + return as(fault, target, targetVal, targetType, localizedMsg) + } + return false + case unwrappableError: + if err = tErr.Unwrap(); err == nil { + return false + } + case unwrappableErrorSlice: + for _, err := range tErr.Unwrap() { + if err == nil { + continue + } + return as(err, target, targetVal, targetType, localizedMsg) + } + return false + default: + return false + } + } +} + +// Is reports whether any fault in err's tree matches target. +// +// The tree is inspected according to the object type. If the object implements +// Golang's error interface, the Unwrap() error or Unwrap() []error methods are +// repeatedly checked for additional errors. If the object implements GoVmomi's +// BaseMethodFault or HasLocalizedMethodFault interfaces, the object is checked +// for an underlying FaultCause. When err wraps multiple errors or faults, err +// is examined followed by a depth-first traversal of its children. +// +// An error is considered to match a target if it is equal to that target or if +// it implements a method IsFault(BaseMethodFault) bool such that +// IsFault(BaseMethodFault) returns true. +// +// An error type might provide an IsFault method so it can be treated as +// equivalent to an existing fault. For example, if MyFault defines: +// +// func (m MyFault) IsFault(target BaseMethodFault) bool { +// return target == &types.NotSupported{} +// } +// +// then IsFault(MyError{}, &types.NotSupported{}) returns true. An IsFault +// method should only shallowly compare err and the target and not unwrap +// either. +func Is(err any, target types.BaseMethodFault) bool { + if target == nil { + return err == target + } + isComparable := reflect.TypeOf(target).Comparable() + return is(err, target, isComparable) +} + +func is(err any, target types.BaseMethodFault, targetComparable bool) bool { + for { + if targetComparable && err == target { + return true + } + if tErr, ok := err.(hasIsFault); ok && tErr.IsFault(target) { + return true + } + switch tErr := err.(type) { + case types.HasLocalizedMethodFault: + fault := tErr.GetLocalizedMethodFault() + if fault == nil { + return false + } + err = fault.Fault + case types.BaseMethodFault: + if reflect.ValueOf(err).Type() == reflect.ValueOf(target).Type() { + return true + } + fault := tErr.GetMethodFault() + if fault == nil { + return false + } + err = fault.FaultCause + case hasFault: + if err = tErr.Fault(); err == nil { + return false + } + case unwrappableError: + if err = tErr.Unwrap(); err == nil { + return false + } + case unwrappableErrorSlice: + for _, err := range tErr.Unwrap() { + if is(err, target, targetComparable) { + return true + } + } + return false + default: + return false + } + } +} + +// OnFaultFn is called for every fault encountered when inspecting an error +// or fault for a fault tree. The In function returns when the entire tree is +// inspected or the OnFaultFn returns true. +type OnFaultFn func( + fault types.BaseMethodFault, + localizedMessage string, + localizableMessages []types.LocalizableMessage) bool + +// In invokes onFaultFn for each fault in err's tree. +// +// The tree is inspected according to the object type. If the object implements +// Golang's error interface, the Unwrap() error or Unwrap() []error methods are +// repeatedly checked for additional errors. If the object implements GoVmomi's +// BaseMethodFault or HasLocalizedMethodFault interfaces, the object is checked +// for an underlying FaultCause. When err wraps multiple errors or faults, err +// is examined followed by a depth-first traversal of its children. +// +// This function panics if err does not implement error, types.BaseMethodFault, +// types.HasLocalizedMethodFault, Fault() types.BaseMethodFault, or if onFaultFn +// is nil. +func In(err any, onFaultFn OnFaultFn) { + if onFaultFn == nil { + panic("fault: onFaultFn must not be nil") + } + switch tErr := err.(type) { + case types.HasLocalizedMethodFault: + inFault(tErr.GetLocalizedMethodFault(), onFaultFn) + case types.BaseMethodFault: + inFault(&types.LocalizedMethodFault{Fault: tErr}, onFaultFn) + case hasFault: + if fault := tErr.Fault(); fault != nil { + inFault(&types.LocalizedMethodFault{Fault: fault}, onFaultFn) + } + case unwrappableError: + In(tErr.Unwrap(), onFaultFn) + case unwrappableErrorSlice: + for _, uErr := range tErr.Unwrap() { + if uErr == nil { + continue + } + In(uErr, onFaultFn) + } + default: + panic("fault: err must implement error, types.BaseMethodFault, or " + + "types.HasLocalizedMethodFault") + } +} + +func inFault( + localizedMethodFault *types.LocalizedMethodFault, + onFaultFn OnFaultFn) { + + if localizedMethodFault == nil { + return + } + + fault := localizedMethodFault.Fault + if fault == nil { + return + } + + var ( + faultCause *types.LocalizedMethodFault + faultMessages []types.LocalizableMessage + ) + + if methodFault := fault.GetMethodFault(); methodFault != nil { + faultCause = methodFault.FaultCause + faultMessages = methodFault.FaultMessage + } + + if onFaultFn(fault, localizedMethodFault.LocalizedMessage, faultMessages) { + return + } + + // Check the fault's children. + inFault(faultCause, onFaultFn) +} + +type hasFault interface { + Fault() types.BaseMethodFault +} + +type hasAsFault interface { + AsFault(target any) (string, bool) +} + +type hasIsFault interface { + IsFault(target types.BaseMethodFault) bool +} + +type unwrappableError interface { + Unwrap() error +} + +type unwrappableErrorSlice interface { + Unwrap() []error +} + +var baseMethodFaultType = reflect.TypeOf((*types.BaseMethodFault)(nil)).Elem() diff --git a/vendor/github.com/vmware/govmomi/internal/version/version.go b/vendor/github.com/vmware/govmomi/internal/version/version.go index fc0a6591..d0b09db9 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.43.0" + ClientVersion = "0.44.1" ) diff --git a/vendor/github.com/vmware/govmomi/list/lister.go b/vendor/github.com/vmware/govmomi/list/lister.go index 92a40e8b..dd1a540e 100644 --- a/vendor/github.com/vmware/govmomi/list/lister.go +++ b/vendor/github.com/vmware/govmomi/list/lister.go @@ -1,11 +1,11 @@ /* -Copyright (c) 2014-2023 VMware, Inc. All Rights Reserved. +Copyright (c) 2014-2024 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, @@ -22,9 +22,9 @@ import ( "path" "reflect" + "github.com/vmware/govmomi/fault" "github.com/vmware/govmomi/property" "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/soap" "github.com/vmware/govmomi/vim25/types" ) @@ -132,12 +132,8 @@ func (l Lister) retrieveProperties(ctx context.Context, req types.RetrieveProper for _, p := range res.Returnval { v, err := mo.ObjectContentToType(p) if err != nil { - // Ignore fault if it is ManagedObjectNotFound - if soap.IsVimFault(err) { - switch soap.ToVimFault(err).(type) { - case *types.ManagedObjectNotFound: - continue - } + if fault.Is(err, &types.ManagedObjectNotFound{}) { + continue } return err diff --git a/vendor/github.com/vmware/govmomi/object/datacenter.go b/vendor/github.com/vmware/govmomi/object/datacenter.go index 8caea3eb..46facadc 100644 --- a/vendor/github.com/vmware/govmomi/object/datacenter.go +++ b/vendor/github.com/vmware/govmomi/object/datacenter.go @@ -20,6 +20,7 @@ import ( "context" "path" + "github.com/vmware/govmomi/fault" "github.com/vmware/govmomi/vim25" "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/mo" @@ -121,10 +122,8 @@ func (d Datacenter) PowerOnVM(ctx context.Context, vm []types.ManagedObjectRefer err = task.Wait(ctx) if err != nil { // Ignore any InvalidPowerState fault, as it indicates the VM is already powered on - if f, ok := err.(types.HasFault); ok { - if _, ok = f.Fault().(*types.InvalidPowerState); !ok { - return nil, err - } + if !fault.Is(err, &types.InvalidPowerState{}) { + return nil, err } } } diff --git a/vendor/github.com/vmware/govmomi/object/datastore.go b/vendor/github.com/vmware/govmomi/object/datastore.go index 991ad4f8..ac157d1f 100644 --- a/vendor/github.com/vmware/govmomi/object/datastore.go +++ b/vendor/github.com/vmware/govmomi/object/datastore.go @@ -105,25 +105,33 @@ func (d Datastore) Path(path string) string { }).String() } -// NewURL constructs a url.URL with the given file path for datastore access over HTTP. -func (d Datastore) NewURL(path string) *url.URL { - u := d.c.URL() - - scheme := u.Scheme +// NewDatastoreURL constructs a url.URL with the given file path for datastore access over HTTP. +func NewDatastoreURL(base url.URL, dcPath, dsName, path string) *url.URL { + scheme := base.Scheme // In rare cases where vCenter and ESX are accessed using different schemes. if overrideScheme := os.Getenv("GOVMOMI_DATASTORE_ACCESS_SCHEME"); overrideScheme != "" { scheme = overrideScheme } - return &url.URL{ - Scheme: scheme, - Host: u.Host, - Path: fmt.Sprintf("/folder/%s", path), - RawQuery: url.Values{ - "dcPath": []string{d.DatacenterPath}, - "dsName": []string{d.Name()}, - }.Encode(), - } + base.Scheme = scheme + base.Path = fmt.Sprintf("/folder/%s", path) + base.RawQuery = url.Values{ + "dcPath": []string{dcPath}, + "dsName": []string{dsName}, + }.Encode() + + return &base +} + +// NewURL constructs a url.URL with the given file path for datastore access over HTTP. +// The Datastore object is used to derive url, dcPath and dsName params to NewDatastoreURL. +// For dcPath, Datastore.DatacenterPath must be set and for dsName, Datastore.InventoryPath. +// This is the case when the object.Datastore instance is created by Finder. +// Otherwise, Datastore.FindInventoryPath should be called first, to set DatacenterPath +// and InventoryPath. +func (d Datastore) NewURL(path string) *url.URL { + u := d.c.URL() + return NewDatastoreURL(*u, d.DatacenterPath, d.Name(), path) } func (d Datastore) Browser(ctx context.Context) (*HostDatastoreBrowser, error) { diff --git a/vendor/github.com/vmware/govmomi/object/host_certificate_manager.go b/vendor/github.com/vmware/govmomi/object/host_certificate_manager.go index 30787e7a..8c8f581d 100644 --- a/vendor/github.com/vmware/govmomi/object/host_certificate_manager.go +++ b/vendor/github.com/vmware/govmomi/object/host_certificate_manager.go @@ -19,11 +19,11 @@ package object import ( "context" + "github.com/vmware/govmomi/fault" "github.com/vmware/govmomi/property" "github.com/vmware/govmomi/vim25" "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/mo" - "github.com/vmware/govmomi/vim25/soap" "github.com/vmware/govmomi/vim25/types" ) @@ -119,10 +119,8 @@ func (m HostCertificateManager) InstallServerCertificate(ctx context.Context, ce } err = m.Client().RoundTrip(ctx, &body, &body) - if err != nil && soap.IsSoapFault(err) { - if _, ok := soap.ToSoapFault(err).VimFault().(types.MethodNotFound); ok { - return nil - } + if err != nil && fault.Is(err, &types.MethodNotFound{}) { + return nil } return err } diff --git a/vendor/github.com/vmware/govmomi/session/manager.go b/vendor/github.com/vmware/govmomi/session/manager.go index 6a24fb95..ac8d11df 100644 --- a/vendor/github.com/vmware/govmomi/session/manager.go +++ b/vendor/github.com/vmware/govmomi/session/manager.go @@ -1,11 +1,11 @@ /* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. +Copyright (c) 2015-2024 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, @@ -21,7 +21,9 @@ import ( "net/url" "os" "strings" + "sync" + "github.com/vmware/govmomi/fault" "github.com/vmware/govmomi/property" "github.com/vmware/govmomi/vim25" "github.com/vmware/govmomi/vim25/methods" @@ -59,6 +61,7 @@ func Secret(value string) (string, error) { type Manager struct { client *vim25.Client userSession *types.UserSession + mu sync.Mutex } func NewManager(client *vim25.Client) *Manager { @@ -69,7 +72,7 @@ func NewManager(client *vim25.Client) *Manager { return &m } -func (sm Manager) Reference() types.ManagedObjectReference { +func (sm *Manager) Reference() types.ManagedObjectReference { return *sm.client.ServiceContent.SessionManager } @@ -83,6 +86,21 @@ func (sm *Manager) SetLocale(ctx context.Context, locale string) error { return err } +func (sm *Manager) setUserSession(val *types.UserSession) { + sm.mu.Lock() + sm.userSession = val + sm.mu.Unlock() +} + +func (sm *Manager) getUserSession() (types.UserSession, bool) { + sm.mu.Lock() + defer sm.mu.Unlock() + if sm.userSession == nil { + return types.UserSession{}, false + } + return *sm.userSession, true +} + func (sm *Manager) Login(ctx context.Context, u *url.Userinfo) error { req := types.Login{ This: sm.Reference(), @@ -101,7 +119,7 @@ func (sm *Manager) Login(ctx context.Context, u *url.Userinfo) error { return err } - sm.userSession = &login.Returnval + sm.setUserSession(&login.Returnval) return nil } @@ -139,7 +157,7 @@ func (sm *Manager) LoginExtensionByCertificate(ctx context.Context, key string) // Copy the session cookie sm.client.Jar.SetCookies(u, c.Jar.Cookies(c.URL())) - sm.userSession = &login.Returnval + sm.setUserSession(&login.Returnval) return nil } @@ -154,7 +172,7 @@ func (sm *Manager) LoginByToken(ctx context.Context) error { return err } - sm.userSession = &login.Returnval + sm.setUserSession(&login.Returnval) return nil } @@ -168,7 +186,7 @@ func (sm *Manager) Logout(ctx context.Context) error { return err } - sm.userSession = nil + sm.setUserSession(nil) return nil } @@ -181,11 +199,8 @@ func (sm *Manager) UserSession(ctx context.Context) (*types.UserSession, error) err := pc.RetrieveOne(ctx, sm.Reference(), []string{"currentSession"}, &mgr) if err != nil { // It's OK if we can't retrieve properties because we're not authenticated - if f, ok := err.(types.HasFault); ok { - switch f.Fault().(type) { - case *types.NotAuthenticated: - return nil, nil - } + if fault.Is(err, &types.NotAuthenticated{}) { + return nil, nil } return nil, err @@ -207,14 +222,15 @@ func (sm *Manager) TerminateSession(ctx context.Context, sessionId []string) err // SessionIsActive checks whether the session that was created at login is // still valid. This function only works against vCenter. func (sm *Manager) SessionIsActive(ctx context.Context) (bool, error) { - if sm.userSession == nil { + userSession, ok := sm.getUserSession() + if !ok { return false, nil } req := types.SessionIsActive{ This: sm.Reference(), - SessionID: sm.userSession.Key, - UserName: sm.userSession.UserName, + SessionID: userSession.Key, + UserName: userSession.UserName, } active, err := methods.SessionIsActive(ctx, sm.client, &req) @@ -277,7 +293,7 @@ func (sm *Manager) CloneSession(ctx context.Context, ticket string) error { return err } - sm.userSession = &res.Returnval + sm.setUserSession(&res.Returnval) return nil } @@ -304,6 +320,6 @@ func (sm *Manager) ImpersonateUser(ctx context.Context, name string) error { return err } - sm.userSession = &res.Returnval + sm.setUserSession(&res.Returnval) return nil } diff --git a/vendor/github.com/vmware/govmomi/vapi/rest/client.go b/vendor/github.com/vmware/govmomi/vapi/rest/client.go index 52552bf0..048b65f3 100644 --- a/vendor/github.com/vmware/govmomi/vapi/rest/client.go +++ b/vendor/github.com/vmware/govmomi/vapi/rest/client.go @@ -1,11 +1,11 @@ /* -Copyright (c) 2018 VMware, Inc. All Rights Reserved. +Copyright (c) 2018-2024 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, @@ -22,8 +22,10 @@ import ( "encoding/json" "fmt" "io" + "mime" "net/http" "net/url" + "os" "strings" "sync" "time" @@ -273,6 +275,36 @@ func (c *Client) DownloadFile(ctx context.Context, file string, u *url.URL, para return c.Client.DownloadFile(ctx, file, u, &p) } +// DownloadAttachment writes the response to given filename, defaulting to Content-Disposition filename in the response. +// A filename of "-" writes the response to stdout. +func (c *Client) DownloadAttachment(ctx context.Context, req *http.Request, filename string) error { + return c.Client.Do(ctx, req, func(res *http.Response) error { + if filename == "" { + d := res.Header.Get("Content-Disposition") + _, params, err := mime.ParseMediaType(d) + if err == nil { + filename = params["filename"] + } + } + + var w io.Writer + + if filename == "-" { + w = os.Stdout + } else { + f, err := os.Create(filename) + if err != nil { + return err + } + defer f.Close() + w = f + } + + _, err := io.Copy(w, res.Body) + return err + }) +} + // Upload wraps soap.Client.Upload, adding the REST authentication header func (c *Client) Upload(ctx context.Context, f io.Reader, u *url.URL, param *soap.Upload) error { p := *param diff --git a/vendor/github.com/vmware/govmomi/vim25/soap/client.go b/vendor/github.com/vmware/govmomi/vim25/soap/client.go index d6c81081..d3e9e093 100644 --- a/vendor/github.com/vmware/govmomi/vim25/soap/client.go +++ b/vendor/github.com/vmware/govmomi/vim25/soap/client.go @@ -135,20 +135,31 @@ func ParseURL(s string) (*url.URL, error) { return u, nil } +// Go's ForceAttemptHTTP2 default is true, we disable by default. +// This undocumented env var can be used to enable. +var http2 = os.Getenv("GOVMOMI_HTTP2") == "true" + func NewClient(u *url.URL, insecure bool) *Client { var t *http.Transport if d, ok := http.DefaultTransport.(*http.Transport); ok { - t = d.Clone() + // Inherit the same defaults explicitly set in http.DefaultTransport, + // unless otherwise noted. + t = &http.Transport{ + Proxy: d.Proxy, + DialContext: d.DialContext, + ForceAttemptHTTP2: http2, // false by default in govmomi + MaxIdleConns: d.MaxIdleConns, + IdleConnTimeout: d.IdleConnTimeout, + TLSHandshakeTimeout: d.TLSHandshakeTimeout, + ExpectContinueTimeout: d.ExpectContinueTimeout, + } } else { t = new(http.Transport) } - if insecure { - if t.TLSClientConfig == nil { - t.TLSClientConfig = new(tls.Config) - } - t.TLSClientConfig.InsecureSkipVerify = insecure + t.TLSClientConfig = &tls.Config{ + InsecureSkipVerify: insecure, } c := newClientWithTransport(u, insecure, t) diff --git a/vendor/github.com/vmware/govmomi/vim25/soap/error.go b/vendor/github.com/vmware/govmomi/vim25/soap/error.go index 5d4fff45..b98da7bb 100644 --- a/vendor/github.com/vmware/govmomi/vim25/soap/error.go +++ b/vendor/github.com/vmware/govmomi/vim25/soap/error.go @@ -1,11 +1,11 @@ /* -Copyright (c) 2014 VMware, Inc. All Rights Reserved. +Copyright (c) 2014-2024 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, @@ -27,14 +27,6 @@ import ( "github.com/vmware/govmomi/vim25/types" ) -type regularError struct { - err error -} - -func (r regularError) Error() string { - return r.err.Error() -} - type soapFaultError struct { fault *Fault } @@ -99,32 +91,6 @@ func (v vimFaultError) Fault() types.BaseMethodFault { return v.fault } -func Wrap(err error) error { - switch err.(type) { - case regularError: - return err - case soapFaultError: - return err - case vimFaultError: - return err - } - - return WrapRegularError(err) -} - -func WrapRegularError(err error) error { - return regularError{err} -} - -func IsRegularError(err error) bool { - _, ok := err.(regularError) - return ok -} - -func ToRegularError(err error) error { - return err.(regularError).err -} - func WrapSoapFault(f *Fault) error { return soapFaultError{f} } @@ -155,15 +121,11 @@ func IsCertificateUntrusted(err error) bool { // golang 1.20 introduce a new type to wrap 509 errors. So instead of // casting the type, now we check the error chain contains the // x509 error or not. - x509UnknownAuthorityErr := &x509.UnknownAuthorityError{} - ok := errors.As(err, x509UnknownAuthorityErr) - if ok { + if errors.Is(err, &x509.UnknownAuthorityError{}) { return true } - x509HostNameErr := &x509.HostnameError{} - ok = errors.As(err, x509HostNameErr) - if ok { + if errors.Is(err, &x509.HostnameError{}) { return true } diff --git a/vendor/github.com/vmware/govmomi/vim25/types/unreleased.go b/vendor/github.com/vmware/govmomi/vim25/types/unreleased.go index 72bc1082..57bc82a1 100644 --- a/vendor/github.com/vmware/govmomi/vim25/types/unreleased.go +++ b/vendor/github.com/vmware/govmomi/vim25/types/unreleased.go @@ -1,17 +1,17 @@ /* - Copyright (c) 2022 VMware, Inc. All Rights Reserved. +Copyright (c) 2022-2024 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 +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. +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 types @@ -75,9 +75,10 @@ func init() { type PlaceVmsXClusterResultPlacementFaults struct { DynamicData - ResourcePool ManagedObjectReference `xml:"resourcePool"` - VmName string `xml:"vmName"` - Faults []LocalizedMethodFault `xml:"faults,omitempty"` + ResourcePool ManagedObjectReference `xml:"resourcePool"` + VmName string `xml:"vmName"` + Faults []LocalizedMethodFault `xml:"faults,omitempty"` + Vm *ManagedObjectReference `xml:"vm,omitempty"` } func init() { @@ -87,18 +88,48 @@ func init() { type PlaceVmsXClusterResultPlacementInfo struct { DynamicData - VmName string `xml:"vmName"` - Recommendation ClusterRecommendation `xml:"recommendation"` + VmName string `xml:"vmName"` + Recommendation ClusterRecommendation `xml:"recommendation"` + Vm *ManagedObjectReference `xml:"vm,omitempty"` } func init() { t["PlaceVmsXClusterResultPlacementInfo"] = reflect.TypeOf((*PlaceVmsXClusterResultPlacementInfo)(nil)).Elem() } +// Defines the type of placement +type PlaceVmsXClusterSpecPlacementType string + +const ( + // Create a new VM to be powered On + PlaceVmsXClusterSpecPlacementTypeCreateAndPowerOn = PlaceVmsXClusterSpecPlacementType("createAndPowerOn") + // Reconfigure a VM + PlaceVmsXClusterSpecPlacementTypeReconfigure = PlaceVmsXClusterSpecPlacementType("reconfigure") + // Relocate a VM + PlaceVmsXClusterSpecPlacementTypeRelocate = PlaceVmsXClusterSpecPlacementType("relocate") +) + +func (e PlaceVmsXClusterSpecPlacementType) Values() []PlaceVmsXClusterSpecPlacementType { + return []PlaceVmsXClusterSpecPlacementType{ + PlaceVmsXClusterSpecPlacementTypeCreateAndPowerOn, + PlaceVmsXClusterSpecPlacementTypeReconfigure, + PlaceVmsXClusterSpecPlacementTypeRelocate, + } +} + +func (e PlaceVmsXClusterSpecPlacementType) Strings() []string { + return EnumValuesAsStrings(e.Values()) +} + +func init() { + t["PlaceVmsXClusterSpecPlacementType"] = reflect.TypeOf((*PlaceVmsXClusterSpecPlacementType)(nil)).Elem() +} + type PlaceVmsXClusterSpec struct { DynamicData ResourcePools []ManagedObjectReference `xml:"resourcePools,omitempty"` + PlacementType string `xml:"placementType,omitempty"` VmPlacementSpecs []PlaceVmsXClusterSpecVmPlacementSpec `xml:"vmPlacementSpecs,omitempty"` HostRecommRequired *bool `xml:"hostRecommRequired"` DatastoreRecommRequired *bool `xml:"datastoreRecommRequired"` @@ -111,7 +142,9 @@ func init() { type PlaceVmsXClusterSpecVmPlacementSpec struct { DynamicData - ConfigSpec VirtualMachineConfigSpec `xml:"configSpec"` + Vm *ManagedObjectReference `xml:"vm,omitempty"` + ConfigSpec VirtualMachineConfigSpec `xml:"configSpec"` + RelocateSpec *VirtualMachineRelocateSpec `xml:"relocateSpec,omitempty"` } func init() { @@ -119,3 +152,25 @@ func init() { } const RecommendationReasonCodeXClusterPlacement = RecommendationReasonCode("xClusterPlacement") + +type ClusterReconfigurePlacementAction struct { + ClusterAction + TargetHost *ManagedObjectReference `xml:"targetHost,omitempty"` + Pool ManagedObjectReference `xml:"pool"` + ConfigSpec *VirtualMachineConfigSpec `xml:"configSpec,omitempty"` +} + +func init() { + t["ClusterReconfigurePlacementAction"] = reflect.TypeOf((*ClusterReconfigurePlacementAction)(nil)).Elem() +} + +type ClusterRelocatePlacementAction struct { + ClusterAction + TargetHost *ManagedObjectReference `xml:"targetHost,omitempty"` + Pool ManagedObjectReference `xml:"pool"` + RelocateSpec *VirtualMachineRelocateSpec `xml:"relocateSpec,omitempty"` +} + +func init() { + t["ClusterRelocatePlacementAction"] = reflect.TypeOf((*ClusterRelocatePlacementAction)(nil)).Elem() +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 6f719ebb..de3c9f8b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -20,9 +20,10 @@ 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.43.0 -## explicit; go 1.21 +# github.com/vmware/govmomi v0.44.1 +## explicit; go 1.22 github.com/vmware/govmomi +github.com/vmware/govmomi/fault github.com/vmware/govmomi/find github.com/vmware/govmomi/history github.com/vmware/govmomi/internal