From 44d54a90a5dee7daff945d32b0fe81c05e5884a5 Mon Sep 17 00:00:00 2001 From: Ilya Alekseyev Date: Wed, 11 Sep 2024 16:55:18 +0000 Subject: [PATCH] Fix test --- pkg/api/v1alpha1/zz_generated.deepcopy.go | 27 +++++++++++++++++++++++ pkg/providers/nutanix/validator_test.go | 8 +++---- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/pkg/api/v1alpha1/zz_generated.deepcopy.go b/pkg/api/v1alpha1/zz_generated.deepcopy.go index b595f09e020a..18e9c4196df7 100644 --- a/pkg/api/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/api/v1alpha1/zz_generated.deepcopy.go @@ -2069,6 +2069,26 @@ func (in *NutanixDatacenterFailureDomain) DeepCopy() *NutanixDatacenterFailureDo return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NutanixGPUIdentifier) DeepCopyInto(out *NutanixGPUIdentifier) { + *out = *in + if in.DeviceID != nil { + in, out := &in.DeviceID, &out.DeviceID + *out = new(int64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NutanixGPUIdentifier. +func (in *NutanixGPUIdentifier) DeepCopy() *NutanixGPUIdentifier { + if in == nil { + return nil + } + out := new(NutanixGPUIdentifier) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NutanixMachineConfig) DeepCopyInto(out *NutanixMachineConfig) { *out = *in @@ -2153,6 +2173,13 @@ func (in *NutanixMachineConfigSpec) DeepCopyInto(out *NutanixMachineConfigSpec) *out = make([]NutanixCategoryIdentifier, len(*in)) copy(*out, *in) } + if in.GPUs != nil { + in, out := &in.GPUs, &out.GPUs + *out = make([]NutanixGPUIdentifier, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NutanixMachineConfigSpec. diff --git a/pkg/providers/nutanix/validator_test.go b/pkg/providers/nutanix/validator_test.go index 634249187484..d0638232e9af 100644 --- a/pkg/providers/nutanix/validator_test.go +++ b/pkg/providers/nutanix/validator_test.go @@ -1124,12 +1124,12 @@ func TestNutanixValidatorValidateFreeGPU(t *testing.T) { DeviceID: utils.Int64Ptr(8757), }, { - Type: "name", - Name: "Ampere 40", + Type: "deviceID", + DeviceID: utils.Int64Ptr(8757), }, { - Type: "name", - Name: "Ampere 40", + Type: "deviceID", + DeviceID: utils.Int64Ptr(8757), }, } clientCache := &ClientCache{clients: map[string]Client{"test": mockClient}}