Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): bump github.com/vmware/govmomi from 0.36.2 to 0.37.1 #422

Merged
merged 1 commit into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 1 addition & 29 deletions builder/vsphere/driver/vm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,17 @@ import (
"context"
"testing"

"github.com/vmware/govmomi/simulator"
"github.com/vmware/govmomi/vim25/methods"
"github.com/vmware/govmomi/vim25/soap"
"github.com/vmware/govmomi/vim25/types"
)

// ReconfigureFail changes the behavior of simulator.VirtualMachine
type ReconfigureFail struct {
*simulator.VirtualMachine
}

// Override simulator.VirtualMachine.ReconfigVMTask to inject faults
func (vm *ReconfigureFail) ReconfigVMTask(req *types.ReconfigVM_Task) soap.HasFault {
task := simulator.CreateTask(req.This, "reconfigure", func(*simulator.Task) (types.AnyType, types.BaseMethodFault) {
return nil, &types.TaskInProgress{}
})

return &methods.ReconfigVM_TaskBody{
Res: &types.ReconfigVM_TaskResponse{
Returnval: task.Run(simulator.SpoofContext()),
},
}
}

func TestVirtualMachineDriver_Configure(t *testing.T) {
sim, err := NewVCenterSimulator()
if err != nil {
t.Fatalf("should not fail: %s", err.Error())
}
defer sim.Close()

vm, machine := sim.ChooseSimulatorPreCreatedVM()
vm, _ := sim.ChooseSimulatorPreCreatedVM()

// Happy test
hardwareConfig := &HardwareConfig{
Expand All @@ -58,13 +37,6 @@ func TestVirtualMachineDriver_Configure(t *testing.T) {
if err = vm.Configure(hardwareConfig); err != nil {
t.Fatalf("should not fail: %s", err.Error())
}

//Fail test
//Wrap the existing vm object with the mocked reconfigure task which will return a fault
simulator.Map.Put(&ReconfigureFail{machine})
if err = vm.Configure(&HardwareConfig{}); err == nil {
t.Fatalf("Configure should fail")
}
}

func TestVirtualMachineDriver_CreateVMWithMultipleDisks(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/pkg/errors v0.9.1
github.com/vmware-tanzu/image-registry-operator-api v0.0.0-20230523235530-62ec5758f097
github.com/vmware-tanzu/vm-operator/api v0.0.0-20230424164826-7ee71aebc7b1
github.com/vmware/govmomi v0.36.2
github.com/vmware/govmomi v0.37.1
github.com/zclconf/go-cty v1.13.3
golang.org/x/mobile v0.0.0-20210901025245-1fde1d6c3ca1
gopkg.in/yaml.v2 v2.4.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,8 @@ github.com/vmware-tanzu/image-registry-operator-api v0.0.0-20230523235530-62ec57
github.com/vmware-tanzu/image-registry-operator-api v0.0.0-20230523235530-62ec5758f097/go.mod h1:S0HMBgdo3S/0a5hwq+Ya4XZI2aEDtGkSGeojU1cINOg=
github.com/vmware-tanzu/vm-operator/api v0.0.0-20230424164826-7ee71aebc7b1 h1:krW4K3Vj8DkVqLMUOlW1OMLr1BY9Lg+PLZ7mAzlJz/A=
github.com/vmware-tanzu/vm-operator/api v0.0.0-20230424164826-7ee71aebc7b1/go.mod h1:vauVboD3sQxP+pb28TnI9wfrj+0nH2zSEc9Q7AzWJ54=
github.com/vmware/govmomi v0.36.2 h1:fFTicZmjwPCiBJGyKLZ5Ty9JbTgBPVSXJDv1Duw0r7c=
github.com/vmware/govmomi v0.36.2/go.mod h1:mtGWtM+YhTADHlCgJBiskSRPOZRsN9MSjPzaZLte/oQ=
github.com/vmware/govmomi v0.37.1 h1:SpI+Ofq+lC1zsLcJ9szLSb7fL4TypReVvUoWIgk2b6U=
github.com/vmware/govmomi v0.37.1/go.mod h1:mtGWtM+YhTADHlCgJBiskSRPOZRsN9MSjPzaZLte/oQ=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down
Loading