From 57da52e6c8122448708fd436a6837fbdfe1235a4 Mon Sep 17 00:00:00 2001 From: Harika Vedati Date: Mon, 17 Mar 2025 15:02:37 -0700 Subject: [PATCH 1/8] adding vm connect properties --- services/compute/virtualmachine/internal/virtualmachine.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/compute/virtualmachine/internal/virtualmachine.go b/services/compute/virtualmachine/internal/virtualmachine.go index 6898f55d..24de067c 100644 --- a/services/compute/virtualmachine/internal/virtualmachine.go +++ b/services/compute/virtualmachine/internal/virtualmachine.go @@ -74,6 +74,9 @@ func (c *client) getWssdVirtualMachine(vm *compute.VirtualMachine) (*wssdcompute ZoneConfiguration: zoneConfig, Entity: entity, Priority: vm.Priority, + Priority: vm.Priority, + HyperVVmId: vm.HyperVVmId, + HostNodeName: vm.HostNodeName, } if vm.DisableHighAvailability != nil { @@ -497,6 +500,8 @@ func (c *client) getVirtualMachine(vm *wssdcompute.VirtualMachine) *compute.Virt HighAvailabilityState: c.getVirtualMachineScaleSetHighAvailabilityState(vm), ZoneConfiguration: c.getVirtualMachineZoneConfiguration(vm), Priority: vm.Priority, + HyperVVmId: vm.HyperVVmId, + HostNodeName: vm.HostNodeName, }, } } From 57e9c0a2b0402e1afac8cd68906a0d9556f3dc7e Mon Sep 17 00:00:00 2001 From: Harika Vedati Date: Mon, 17 Mar 2025 15:03:18 -0700 Subject: [PATCH 2/8] remove dup property --- services/compute/virtualmachine/internal/virtualmachine.go | 1 - 1 file changed, 1 deletion(-) diff --git a/services/compute/virtualmachine/internal/virtualmachine.go b/services/compute/virtualmachine/internal/virtualmachine.go index 24de067c..f29e320f 100644 --- a/services/compute/virtualmachine/internal/virtualmachine.go +++ b/services/compute/virtualmachine/internal/virtualmachine.go @@ -74,7 +74,6 @@ func (c *client) getWssdVirtualMachine(vm *compute.VirtualMachine) (*wssdcompute ZoneConfiguration: zoneConfig, Entity: entity, Priority: vm.Priority, - Priority: vm.Priority, HyperVVmId: vm.HyperVVmId, HostNodeName: vm.HostNodeName, } From 6d9ca6b6fa9bd5e7e3317e0c8c210ad2f9380894 Mon Sep 17 00:00:00 2001 From: Harika Vedati Date: Fri, 11 Apr 2025 13:17:05 -0700 Subject: [PATCH 3/8] adding vmid and hostnodename functions --- go.mod | 6 ++-- go.sum | 14 ++++++---- services/compute/compute.go | 8 ++++++ services/compute/virtualmachine/client.go | 10 +++++++ .../virtualmachine/internal/virtualmachine.go | 4 --- .../compute/virtualmachine/internal/wssd.go | 28 +++++++++++++++++++ 6 files changed, 58 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index bcbbc450..3f1b7612 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/stretchr/testify v1.9.0 go.opencensus.io v0.24.0 google.golang.org/grpc v1.60.1 - google.golang.org/protobuf v1.36.2 + google.golang.org/protobuf v1.36.4 k8s.io/klog v1.0.0 ) @@ -39,7 +39,7 @@ require ( golang.org/x/net v0.34.0 // indirect golang.org/x/sys v0.29.0 // indirect golang.org/x/text v0.21.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250127172529-29210b9bc287 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect @@ -47,8 +47,10 @@ require ( replace ( github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2 + github.com/microsoft/moc => github.com/hvedati/moc v0.11.1-alpha github.com/miekg/dns => github.com/miekg/dns v1.1.25 golang.org/x/crypto => golang.org/x/crypto v0.32.0 golang.org/x/image => golang.org/x/image v0.23.0 golang.org/x/sys => golang.org/x/sys v0.0.0-20220823224334-20c2bfdbfe24 + //github.com/microsoft/moc => ../moc ) diff --git a/go.sum b/go.sum index a4e24c69..ff0c649d 100644 --- a/go.sum +++ b/go.sum @@ -142,6 +142,10 @@ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/hvedati/moc v0.11.0-alpha h1:jyeogURB8GEaEKPuGOszm/dW5NjPNFrTxWBy57Q1DJI= +github.com/hvedati/moc v0.11.0-alpha/go.mod h1:fml48yfCVfYDmpoL1Yt40dN5dLOyQbN9UeBKlQxLiG4= +github.com/hvedati/moc v0.11.1-alpha h1:Oaaxw9+AhXQ/GhtNg5qCMEHXlk7ehRNsZBWaWYCIsH8= +github.com/hvedati/moc v0.11.1-alpha/go.mod h1:fml48yfCVfYDmpoL1Yt40dN5dLOyQbN9UeBKlQxLiG4= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= @@ -162,8 +166,6 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/microsoft/moc v0.25.5 h1:ZusF4O/+yzPkjeaCBQO5v/eSofxQtDoUmrPqOmq7HwE= -github.com/microsoft/moc v0.25.5/go.mod h1:Imw1xly6vIx3htE3vQ8dvfUoK91XULa0KBLkvq6CJPk= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= @@ -478,8 +480,8 @@ google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422 h1:3UsHvIr4Wc2aW4brOaSCmcxh9ksica6fHEr8P1XhkYw= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422/go.mod h1:3ENsm/5D1mzDyhpzeRi1NR784I0BcofWBoSc5QqqMK4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250127172529-29210b9bc287 h1:J1H9f+LEdWAfHcez/4cvaVBox7cOYT+IU6rgqj5x++8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250127172529-29210b9bc287/go.mod h1:8BS3B93F/U1juMFq9+EDk+qOT5CO1R9IzXxG3PTqiRk= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -510,8 +512,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.36.2 h1:R8FeyR1/eLmkutZOM5CWghmo5itiG9z0ktFlTVLuTmU= -google.golang.org/protobuf v1.36.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +google.golang.org/protobuf v1.36.4 h1:6A3ZDJHn/eNqc1i+IdefRzy/9PokBTPvcqMySR7NNIM= +google.golang.org/protobuf v1.36.4/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/services/compute/compute.go b/services/compute/compute.go index 8511dbd6..546a5e51 100644 --- a/services/compute/compute.go +++ b/services/compute/compute.go @@ -727,3 +727,11 @@ type ZoneConfiguration struct { // Strict Placement StrictPlacement *bool `json:"strictPlacement,omitempty"` } + +type VirtualMachineHyperVVmId struct { + HyperVVmId *string `json:"hyperVVmId ,omitempty"` +} + +type VirtualMachineHostNodeName struct { + HostNodeName *string `json:"hostNodeName ,omitempty"` +} diff --git a/services/compute/virtualmachine/client.go b/services/compute/virtualmachine/client.go index 1dee23a1..bfd62291 100644 --- a/services/compute/virtualmachine/client.go +++ b/services/compute/virtualmachine/client.go @@ -28,6 +28,8 @@ type Service interface { RepairGuestAgent(context.Context, string, string) error RunCommand(context.Context, string, string, *compute.VirtualMachineRunCommandRequest) (*compute.VirtualMachineRunCommandResponse, error) Validate(context.Context, string, string) error + GetHyperVVmId(context.Context, string, string) (*compute.VirtualMachineHyperVVmId, error) + GetHostNodeName(context.Context, string, string) (*compute.VirtualMachineHostNodeName, error) } type VirtualMachineClient struct { @@ -277,6 +279,14 @@ func (c *VirtualMachineClient) RunCommand(ctx context.Context, group, vmName str return c.internal.RunCommand(ctx, group, vmName, request) } +func (c *VirtualMachineClient) GetHyperVVmId(ctx context.Context, group string, name string) (*compute.VirtualMachineHyperVVmId, error) { + return c.internal.GetHyperVVmId(ctx, group, name) +} + +func (c *VirtualMachineClient) GetHostNodeName(ctx context.Context, group string, name string) (*compute.VirtualMachineHostNodeName, error) { + return c.internal.GetHostNodeName(ctx, group, name) +} + func isDifferentVmSize(oldSizeType, newSizeType compute.VirtualMachineSizeTypes, oldCustomSize, newCustomSize *compute.VirtualMachineCustomSize) bool { if oldSizeType != newSizeType { return true diff --git a/services/compute/virtualmachine/internal/virtualmachine.go b/services/compute/virtualmachine/internal/virtualmachine.go index f29e320f..6898f55d 100644 --- a/services/compute/virtualmachine/internal/virtualmachine.go +++ b/services/compute/virtualmachine/internal/virtualmachine.go @@ -74,8 +74,6 @@ func (c *client) getWssdVirtualMachine(vm *compute.VirtualMachine) (*wssdcompute ZoneConfiguration: zoneConfig, Entity: entity, Priority: vm.Priority, - HyperVVmId: vm.HyperVVmId, - HostNodeName: vm.HostNodeName, } if vm.DisableHighAvailability != nil { @@ -499,8 +497,6 @@ func (c *client) getVirtualMachine(vm *wssdcompute.VirtualMachine) *compute.Virt HighAvailabilityState: c.getVirtualMachineScaleSetHighAvailabilityState(vm), ZoneConfiguration: c.getVirtualMachineZoneConfiguration(vm), Priority: vm.Priority, - HyperVVmId: vm.HyperVVmId, - HostNodeName: vm.HostNodeName, }, } } diff --git a/services/compute/virtualmachine/internal/wssd.go b/services/compute/virtualmachine/internal/wssd.go index ab01aaa1..5a321e4f 100644 --- a/services/compute/virtualmachine/internal/wssd.go +++ b/services/compute/virtualmachine/internal/wssd.go @@ -114,6 +114,34 @@ func (c *client) Hydrate(ctx context.Context, group, name string, sg *compute.Vi return &(*vms)[0], nil } +func (c *client) GetHyperVVmId(ctx context.Context, group, name string) (*compute.VirtualMachineHyperVVmId, error) { + vm, err := c.get(ctx, group, name) + + mocResponse, err := c.VirtualMachineAgentClient.GetHyperVVmId(ctx, vm[0]) + if err != nil { + return nil, err + } + response := &compute.VirtualMachineHyperVVmId{ + HyperVVmId: &mocResponse.HyperVVmId, + } + + return response, nil +} + +func (c *client) GetHostNodeName(ctx context.Context, group, name string) (*compute.VirtualMachineHostNodeName, error) { + vm, err := c.get(ctx, group, name) + + mocResponse, err := c.VirtualMachineAgentClient.GetHostNodeName(ctx, vm[0]) + if err != nil { + return nil, err + } + response := &compute.VirtualMachineHostNodeName{ + HostNodeName: &mocResponse.HostNodeName, + } + + return response, nil +} + func (c *client) Start(ctx context.Context, group, name string) (err error) { request, err := c.getVirtualMachineOperationRequest(ctx, wssdcommonproto.VirtualMachineOperation_START, name) if err != nil { From 6455869a967092a4bde803b6eca8c849ae1c5ef9 Mon Sep 17 00:00:00 2001 From: Harika Vedati Date: Fri, 11 Apr 2025 13:54:46 -0700 Subject: [PATCH 4/8] fixing lint error --- services/compute/virtualmachine/internal/wssd.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/compute/virtualmachine/internal/wssd.go b/services/compute/virtualmachine/internal/wssd.go index 5a321e4f..3ab37106 100644 --- a/services/compute/virtualmachine/internal/wssd.go +++ b/services/compute/virtualmachine/internal/wssd.go @@ -116,6 +116,9 @@ func (c *client) Hydrate(ctx context.Context, group, name string, sg *compute.Vi func (c *client) GetHyperVVmId(ctx context.Context, group, name string) (*compute.VirtualMachineHyperVVmId, error) { vm, err := c.get(ctx, group, name) + if err != nil { + return + } mocResponse, err := c.VirtualMachineAgentClient.GetHyperVVmId(ctx, vm[0]) if err != nil { @@ -130,6 +133,9 @@ func (c *client) GetHyperVVmId(ctx context.Context, group, name string) (*comput func (c *client) GetHostNodeName(ctx context.Context, group, name string) (*compute.VirtualMachineHostNodeName, error) { vm, err := c.get(ctx, group, name) + if err != nil { + return + } mocResponse, err := c.VirtualMachineAgentClient.GetHostNodeName(ctx, vm[0]) if err != nil { From 04e4fbcf6cf7529f351e94f3a23de89e336aa7c2 Mon Sep 17 00:00:00 2001 From: Harika Vedati Date: Fri, 11 Apr 2025 14:12:22 -0700 Subject: [PATCH 5/8] fixing return --- services/compute/virtualmachine/internal/wssd.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/compute/virtualmachine/internal/wssd.go b/services/compute/virtualmachine/internal/wssd.go index 3ab37106..e665b4f9 100644 --- a/services/compute/virtualmachine/internal/wssd.go +++ b/services/compute/virtualmachine/internal/wssd.go @@ -117,7 +117,7 @@ func (c *client) Hydrate(ctx context.Context, group, name string, sg *compute.Vi func (c *client) GetHyperVVmId(ctx context.Context, group, name string) (*compute.VirtualMachineHyperVVmId, error) { vm, err := c.get(ctx, group, name) if err != nil { - return + return nil, err } mocResponse, err := c.VirtualMachineAgentClient.GetHyperVVmId(ctx, vm[0]) @@ -134,7 +134,7 @@ func (c *client) GetHyperVVmId(ctx context.Context, group, name string) (*comput func (c *client) GetHostNodeName(ctx context.Context, group, name string) (*compute.VirtualMachineHostNodeName, error) { vm, err := c.get(ctx, group, name) if err != nil { - return + return nil, err } mocResponse, err := c.VirtualMachineAgentClient.GetHostNodeName(ctx, vm[0]) From a195dd723631cc71b36216c3485cd3a7400b9053 Mon Sep 17 00:00:00 2001 From: Harika Vedati Date: Fri, 11 Apr 2025 16:58:56 -0700 Subject: [PATCH 6/8] updating to .2 --- go.mod | 4 ++-- go.sum | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 3f1b7612..3647ffb8 100644 --- a/go.mod +++ b/go.mod @@ -47,10 +47,10 @@ require ( replace ( github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2 - github.com/microsoft/moc => github.com/hvedati/moc v0.11.1-alpha + github.com/microsoft/moc => github.com/hvedati/moc v0.11.2-alpha github.com/miekg/dns => github.com/miekg/dns v1.1.25 golang.org/x/crypto => golang.org/x/crypto v0.32.0 golang.org/x/image => golang.org/x/image v0.23.0 golang.org/x/sys => golang.org/x/sys v0.0.0-20220823224334-20c2bfdbfe24 - //github.com/microsoft/moc => ../moc + ) diff --git a/go.sum b/go.sum index ff0c649d..874ed3ae 100644 --- a/go.sum +++ b/go.sum @@ -146,6 +146,8 @@ github.com/hvedati/moc v0.11.0-alpha h1:jyeogURB8GEaEKPuGOszm/dW5NjPNFrTxWBy57Q1 github.com/hvedati/moc v0.11.0-alpha/go.mod h1:fml48yfCVfYDmpoL1Yt40dN5dLOyQbN9UeBKlQxLiG4= github.com/hvedati/moc v0.11.1-alpha h1:Oaaxw9+AhXQ/GhtNg5qCMEHXlk7ehRNsZBWaWYCIsH8= github.com/hvedati/moc v0.11.1-alpha/go.mod h1:fml48yfCVfYDmpoL1Yt40dN5dLOyQbN9UeBKlQxLiG4= +github.com/hvedati/moc v0.11.2-alpha h1:9d392A4PzSOOxLKVqqMa07DEWu2UtKFtQIm9IOLotCc= +github.com/hvedati/moc v0.11.2-alpha/go.mod h1:emM0LStnDYZRIUP9bAdpOQ2G/h1Ry1oyxCDQmq25TeU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= From d4de6fd31dcb2d0bc2fd4b00dea3343b4de47eb1 Mon Sep 17 00:00:00 2001 From: Harika Vedati Date: Mon, 26 May 2025 18:24:38 -0700 Subject: [PATCH 7/8] update tags --- go.mod | 11 ++++++----- go.sum | 10 ++-------- pkg/client/client.go | 4 ++-- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index caa651c4..607be5bd 100644 --- a/go.mod +++ b/go.mod @@ -39,17 +39,18 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.4.2 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.34.0 // indirect - golang.org/x/sys v0.29.0 // indirect - golang.org/x/text v0.21.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250127172529-29210b9bc287 // indirect + golang.org/x/net v0.39.0 // indirect + golang.org/x/sys v0.32.0 // indirect + golang.org/x/text v0.24.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250428153025-10db94c68c34 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + replace ( github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2 - github.com/microsoft/moc => github.com/hvedati/moc v0.11.2-alpha + github.com/microsoft/moc => github.com/hvedati/moc v0.11.0-alpha.3 github.com/miekg/dns => github.com/miekg/dns v1.1.25 golang.org/x/crypto => golang.org/x/crypto v0.32.0 golang.org/x/image => golang.org/x/image v0.23.0 diff --git a/go.sum b/go.sum index e85e68c4..3e265b83 100644 --- a/go.sum +++ b/go.sum @@ -148,12 +148,8 @@ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/hvedati/moc v0.11.0-alpha h1:jyeogURB8GEaEKPuGOszm/dW5NjPNFrTxWBy57Q1DJI= -github.com/hvedati/moc v0.11.0-alpha/go.mod h1:fml48yfCVfYDmpoL1Yt40dN5dLOyQbN9UeBKlQxLiG4= -github.com/hvedati/moc v0.11.1-alpha h1:Oaaxw9+AhXQ/GhtNg5qCMEHXlk7ehRNsZBWaWYCIsH8= -github.com/hvedati/moc v0.11.1-alpha/go.mod h1:fml48yfCVfYDmpoL1Yt40dN5dLOyQbN9UeBKlQxLiG4= -github.com/hvedati/moc v0.11.2-alpha h1:9d392A4PzSOOxLKVqqMa07DEWu2UtKFtQIm9IOLotCc= -github.com/hvedati/moc v0.11.2-alpha/go.mod h1:emM0LStnDYZRIUP9bAdpOQ2G/h1Ry1oyxCDQmq25TeU= +github.com/hvedati/moc v0.11.0-alpha.3 h1:j92P8dubAZWCDPqT9biL7uf8uJyMXXIeN5wJh7d1DKY= +github.com/hvedati/moc v0.11.0-alpha.3/go.mod h1:ZZ4/WPkZCkm3I0UWRiO5P4uR9kpMG9/iGoiAs3K8Cjo= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= @@ -174,8 +170,6 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/microsoft/moc v0.28.7 h1:ib7Hpq3Tl5/LuGviW2GI9tJP42cHNfONqhtgBsvbjuw= -github.com/microsoft/moc v0.28.7/go.mod h1:ZZ4/WPkZCkm3I0UWRiO5P4uR9kpMG9/iGoiAs3K8Cjo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= diff --git a/pkg/client/client.go b/pkg/client/client.go index 03dfdba8..e9846b92 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -94,7 +94,7 @@ func GetServerAddress(cc *grpc.ClientConn) string { defer mux.Unlock() for key, value := range connectionCache { - if value == cc { + if value == cc { return key } } @@ -109,7 +109,7 @@ func AddNodeNameToErrorMessageInterceptor() grpc.UnaryClientInterceptor { serverAddressPort := GetServerAddress(cc) if len(serverAddressPort) != 0 { serverAddress := (strings.Split(serverAddressPort, ":"))[0] - err = errors.Wrapf(err, "nodename = %s", serverAddress) + err = errors.Wrapf(err, "nodename = %s", serverAddress) } } From fa51cfb67c3be2da94e714d101bda9ea2c9cf8a0 Mon Sep 17 00:00:00 2001 From: Harika Vedati Date: Thu, 26 Jun 2025 15:44:12 -0700 Subject: [PATCH 8/8] removing hostnodename function --- go.mod | 10 +++++----- go.sum | 8 ++++++++ services/compute/virtualmachine/client.go | 5 ----- .../compute/virtualmachine/internal/wssd.go | 17 ----------------- 4 files changed, 13 insertions(+), 27 deletions(-) diff --git a/go.mod b/go.mod index 607be5bd..e694f1d8 100644 --- a/go.mod +++ b/go.mod @@ -39,10 +39,10 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.4.2 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.39.0 // indirect - golang.org/x/sys v0.32.0 // indirect - golang.org/x/text v0.24.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250428153025-10db94c68c34 // indirect + golang.org/x/net v0.41.0 // indirect + golang.org/x/sys v0.33.0 // indirect + golang.org/x/text v0.26.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect @@ -50,7 +50,7 @@ require ( replace ( github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2 - github.com/microsoft/moc => github.com/hvedati/moc v0.11.0-alpha.3 + github.com/microsoft/moc => github.com/hvedati/moc v0.11.0-alpha.5 github.com/miekg/dns => github.com/miekg/dns v1.1.25 golang.org/x/crypto => golang.org/x/crypto v0.32.0 golang.org/x/image => golang.org/x/image v0.23.0 diff --git a/go.sum b/go.sum index 3e265b83..f2357b85 100644 --- a/go.sum +++ b/go.sum @@ -150,6 +150,8 @@ github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/hvedati/moc v0.11.0-alpha.3 h1:j92P8dubAZWCDPqT9biL7uf8uJyMXXIeN5wJh7d1DKY= github.com/hvedati/moc v0.11.0-alpha.3/go.mod h1:ZZ4/WPkZCkm3I0UWRiO5P4uR9kpMG9/iGoiAs3K8Cjo= +github.com/hvedati/moc v0.11.0-alpha.5 h1:W+6AA83jRhm6qfyo9F1Val4/VrbwcUoZtrk02WP5ed0= +github.com/hvedati/moc v0.11.0-alpha.5/go.mod h1:h/tslUhMoPTK8nJZwlOQ91Ru3Vqhm8pKjYkBX0ECQsE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= @@ -326,6 +328,8 @@ golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY= golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E= +golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw= +golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -376,6 +380,8 @@ golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= +golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M= +golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -499,6 +505,8 @@ google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto/googleapis/rpc v0.0.0-20250428153025-10db94c68c34 h1:h6p3mQqrmT1XkHVTfzLdNz1u7IhINeZkz67/xTbOuWs= google.golang.org/genproto/googleapis/rpc v0.0.0-20250428153025-10db94c68c34/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 h1:fc6jSaCT0vBduLYZHYrBBNY4dsWuvgyff9noRNDdBeE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/services/compute/virtualmachine/client.go b/services/compute/virtualmachine/client.go index bfd62291..68466a03 100644 --- a/services/compute/virtualmachine/client.go +++ b/services/compute/virtualmachine/client.go @@ -29,7 +29,6 @@ type Service interface { RunCommand(context.Context, string, string, *compute.VirtualMachineRunCommandRequest) (*compute.VirtualMachineRunCommandResponse, error) Validate(context.Context, string, string) error GetHyperVVmId(context.Context, string, string) (*compute.VirtualMachineHyperVVmId, error) - GetHostNodeName(context.Context, string, string) (*compute.VirtualMachineHostNodeName, error) } type VirtualMachineClient struct { @@ -283,10 +282,6 @@ func (c *VirtualMachineClient) GetHyperVVmId(ctx context.Context, group string, return c.internal.GetHyperVVmId(ctx, group, name) } -func (c *VirtualMachineClient) GetHostNodeName(ctx context.Context, group string, name string) (*compute.VirtualMachineHostNodeName, error) { - return c.internal.GetHostNodeName(ctx, group, name) -} - func isDifferentVmSize(oldSizeType, newSizeType compute.VirtualMachineSizeTypes, oldCustomSize, newCustomSize *compute.VirtualMachineCustomSize) bool { if oldSizeType != newSizeType { return true diff --git a/services/compute/virtualmachine/internal/wssd.go b/services/compute/virtualmachine/internal/wssd.go index e665b4f9..b1dd8fa0 100644 --- a/services/compute/virtualmachine/internal/wssd.go +++ b/services/compute/virtualmachine/internal/wssd.go @@ -131,23 +131,6 @@ func (c *client) GetHyperVVmId(ctx context.Context, group, name string) (*comput return response, nil } -func (c *client) GetHostNodeName(ctx context.Context, group, name string) (*compute.VirtualMachineHostNodeName, error) { - vm, err := c.get(ctx, group, name) - if err != nil { - return nil, err - } - - mocResponse, err := c.VirtualMachineAgentClient.GetHostNodeName(ctx, vm[0]) - if err != nil { - return nil, err - } - response := &compute.VirtualMachineHostNodeName{ - HostNodeName: &mocResponse.HostNodeName, - } - - return response, nil -} - func (c *client) Start(ctx context.Context, group, name string) (err error) { request, err := c.getVirtualMachineOperationRequest(ctx, wssdcommonproto.VirtualMachineOperation_START, name) if err != nil {