Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vmware/govmomi
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.47.1
Choose a base ref
...
head repository: vmware/govmomi
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.48.0
Choose a head ref
Loading
Showing with 3,502 additions and 908 deletions.
  1. +0 −43 .goreleaser.yml
  2. +5 −32 cli/disk/attach.go
  3. +7 −30 cli/disk/create.go
  4. +3 −15 cli/disk/detach.go
  5. +98 −32 cli/disk/ls.go
  6. +285 −0 cli/disk/manager.go
  7. +115 −0 cli/disk/metadata/ls.go
  8. +80 −0 cli/disk/metadata/update.go
  9. +8 −18 cli/disk/register.go
  10. +8 −31 cli/disk/rm.go
  11. +8 −29 cli/disk/snapshot/create.go
  12. +8 −20 cli/disk/snapshot/ls.go
  13. +7 −28 cli/disk/snapshot/rm.go
  14. +8 −17 cli/disk/tags.go
  15. +4 −16 cli/namespace/service/activate.go
  16. +32 −36 cli/namespace/service/create.go
  17. +4 −16 cli/namespace/service/deactivate.go
  18. +63 −0 cli/namespace/service/flag.go
  19. +4 −17 cli/namespace/service/info.go
  20. +4 −16 cli/namespace/service/ls.go
  21. +5 −16 cli/namespace/service/rm.go
  22. +57 −0 cli/namespace/service/version/activate.go
  23. +87 −0 cli/namespace/service/version/create.go
  24. +57 −0 cli/namespace/service/version/deactivate.go
  25. +104 −0 cli/namespace/service/version/info.go
  26. +107 −0 cli/namespace/service/version/ls.go
  27. +58 −0 cli/namespace/service/version/rm.go
  28. +1 −0 cns/types/types.go
  29. +167 −10 govc/USAGE.md
  30. +2 −0 govc/main.go
  31. +160 −6 govc/test/disk.bats
  32. +7 −1 govc/test/import.bats
  33. +1 −0 govc/test/library.bats
  34. +44 −2 govc/test/namespace.bats
  35. +6 −4 govc/test/test_helper.bash
  36. +1 −1 govc/test/vm.bats
  37. +1 −1 internal/version/version.go
  38. +3 −15 lookup/simulator/example_test.go
  39. +8 −19 lookup/simulator/registration_info.go
  40. +23 −30 lookup/simulator/simulator.go
  41. +3 −15 lookup/simulator/simulator_test.go
  42. +35 −15 object/datastore_test.go
  43. +61 −0 object/namespace_manager_test.go
  44. +12 −17 ovf/importer/archive.go
  45. +2 −2 session/cache/session.go
  46. +123 −16 simulator/datastore_namespace_manager.go
  47. +4 −18 simulator/esx/datacenter.go
  48. +4 −15 simulator/model.go
  49. +8 −15 simulator/registry.go
  50. +12 −15 simulator/session_manager.go
  51. +9 −16 simulator/simulator.go
  52. +4 −16 simulator/virtual_machine.go
  53. +60 −15 simulator/vstorage_object_manager.go
  54. +16 −15 ssoadmin/client.go
  55. +20 −16 ssoadmin/client_test.go
  56. +50 −15 ssoadmin/simulator/simulator.go
  57. +4 −15 vapi/namespace/internal/internal.go
  58. +98 −29 vapi/namespace/simulator/simulator.go
  59. +99 −27 vapi/namespace/supervisorsvc.go
  60. +5 −17 vapi/simulator/simulator.go
  61. +4 −15 vcsim/main.go
  62. +21 −15 vim25/mo/registry.go
  63. +8 −15 vim25/mo/retrieve.go
  64. +47 −15 vim25/mo/retrieve_test.go
  65. +7 −17 vim25/mo/type_info.go
  66. +18 −3 vim25/soap/client.go
  67. +26 −0 vim25/soap/client_test.go
  68. +41 −18 vslm/global_object_manager.go
  69. +228 −0 vslm/global_object_manager_test.go
  70. +777 −0 vslm/simulator/simulator.go
  71. +46 −0 vslm/simulator/simulator_test.go
43 changes: 0 additions & 43 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -92,49 +92,6 @@ changelog:
- Merge pull request
- Merge branch

# upload disabled since it is maintained in homebrew-core
brews:
- name: govc
ids:
- govcbuild
repository:
owner: govmomi
name: homebrew-tap
# TODO: create token in specified tap repo, add as secret to govmomi repo and reference in release workflow
# token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
# enable once we do fully automated releases
skip_upload: true
commit_author:
name: Alfred the Narwhal
email: cna-alfred@vmware.com
directory: Formula
homepage: "https://github.com/vmware/govmomi/blob/main/govc/README.md"
description: "govc is a vSphere CLI built on top of govmomi."
test: |
system "#{bin}/govc version"
install: |
bin.install "govc"
- name: vcsim
ids:
- vcsimbuild
repository:
owner: govmomi
name: homebrew-tap
# TODO: create token in specified tap repo, add as secret to govmomi repo and reference in release workflow
# token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
# enable once we do fully automated releases
skip_upload: true
commit_author:
name: Alfred the Narwhal
email: cna-alfred@vmware.com
directory: Formula
homepage: "https://github.com/vmware/govmomi/blob/main/vcsim/README.md"
description: "vcsim is a vSphere API simulator built on top of govmomi."
test: |
system "#{bin}/vcsim -h"
install: |
bin.install "vcsim"
dockers:
- image_templates:
- "vmware/govc:{{ .Tag }}"
37 changes: 5 additions & 32 deletions cli/disk/attach.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
/*
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.
*/
// © Broadcom. All Rights Reserved.
// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.
// SPDX-License-Identifier: Apache-2.0

package disk

@@ -22,7 +10,6 @@ import (

"github.com/vmware/govmomi/cli"
"github.com/vmware/govmomi/cli/flags"
"github.com/vmware/govmomi/vim25/mo"
)

type attach struct {
@@ -67,7 +54,7 @@ func (cmd *attach) Run(ctx context.Context, f *flag.FlagSet) error {
return flag.ErrHelp
}

ds, err := cmd.DatastoreIfSpecified()
m, err := NewManagerFromFlag(ctx, cmd.DatastoreFlag)
if err != nil {
return err
}
@@ -77,21 +64,7 @@ func (cmd *attach) Run(ctx context.Context, f *flag.FlagSet) error {
return err
}

if ds == nil {
var props mo.VirtualMachine
err = vm.Properties(ctx, vm.Reference(), []string{"datastore"}, &props)
if err != nil {
return err
}
if len(props.Datastore) != 1 {
ds, err = cmd.Datastore() // likely results in MultipleFoundError
if err != nil {
return err
}
}
}

id := f.Arg(0)

return vm.AttachDisk(ctx, id, ds, 0, nil)
return m.AttachDisk(ctx, vm, id)
}
37 changes: 7 additions & 30 deletions cli/disk/create.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
/*
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
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.
*/
// © Broadcom. All Rights Reserved.
// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.
// SPDX-License-Identifier: Apache-2.0

package disk

@@ -27,7 +15,6 @@ import (
"github.com/vmware/govmomi/units"
"github.com/vmware/govmomi/vim25/mo"
"github.com/vmware/govmomi/vim25/types"
"github.com/vmware/govmomi/vslm"
)

type disk struct {
@@ -92,7 +79,7 @@ func (cmd *disk) Run(ctx context.Context, f *flag.FlagSet) error {
return flag.ErrHelp
}

c, err := cmd.DatastoreFlag.Client()
m, err := NewManagerFromFlag(ctx, cmd.DatastoreFlag)
if err != nil {
return err
}
@@ -120,8 +107,6 @@ func (cmd *disk) Run(ctx context.Context, f *flag.FlagSet) error {
return err
}

m := vslm.NewObjectManager(c)

spec := types.VslmCreateSpec{
Name: name,
CapacityInMB: int64(cmd.size) / units.MB,
@@ -136,25 +121,17 @@ func (cmd *disk) Run(ctx context.Context, f *flag.FlagSet) error {
}

if cmd.StoragePodFlag.Isset() {
if err = m.PlaceDisk(ctx, &spec, pool.Reference()); err != nil {
if err = m.ObjectManager.PlaceDisk(ctx, &spec, pool.Reference()); err != nil {
return err
}
}

task, err := m.CreateDisk(ctx, spec)
if err != nil {
return nil
}

logger := cmd.DatastoreFlag.ProgressLogger(fmt.Sprintf("Creating %s...", spec.Name))

res, err := task.WaitForResult(ctx, logger)
logger.Wait()
obj, err := m.CreateDisk(ctx, spec)
if err != nil {
return err
}

fmt.Println(res.Result.(types.VStorageObject).Config.Id.Id)
fmt.Println(obj.Config.Id.Id)

return nil
}
18 changes: 3 additions & 15 deletions cli/disk/detach.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
/*
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.
*/
// © Broadcom. All Rights Reserved.
// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.
// SPDX-License-Identifier: Apache-2.0

package disk

Loading