diff --git a/api/v1alpha1/ionoscloudmachine_types.go b/api/v1alpha1/ionoscloudmachine_types.go index 3494079e..c07098aa 100644 --- a/api/v1alpha1/ionoscloudmachine_types.go +++ b/api/v1alpha1/ionoscloudmachine_types.go @@ -151,8 +151,11 @@ type IonosCloudMachineSpec struct { Disk *Volume `json:"disk"` // AdditionalNetworks defines the additional network configurations for the VM. + // + // +listType=map + // +listMapKey=networkID //+optional - AdditionalNetworks Networks `json:"additionalNetworks,omitempty"` + AdditionalNetworks []Network `json:"additionalNetworks,omitempty"` // IPAMConfig allows to obtain IP Addresses from existing IP pools instead of using DHCP. IPAMConfig `json:",inline"` @@ -175,11 +178,6 @@ type IonosCloudMachineSpec struct { Type ServerType `json:"type,omitempty"` } -// Networks contains a list of additional LAN IDs that should be attached to the VM. -// +listType=map -// +listMapKey=networkID -type Networks []Network - // Network contains the config for additional LANs. type Network struct { // NetworkID represents an ID an existing LAN in the data center. diff --git a/api/v1alpha1/ionoscloudmachine_types_test.go b/api/v1alpha1/ionoscloudmachine_types_test.go index ae986c28..8ce11396 100644 --- a/api/v1alpha1/ionoscloudmachine_types_test.go +++ b/api/v1alpha1/ionoscloudmachine_types_test.go @@ -55,7 +55,7 @@ func defaultMachine() *IonosCloudMachine { ID: "1eef-48ec-a246-a51a33aa4f3a", }, }, - AdditionalNetworks: Networks{ + AdditionalNetworks: []Network{ { NetworkID: 1, }, diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 0ad7b4e3..736fcfaf 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -383,7 +383,7 @@ func (in *IonosCloudMachineSpec) DeepCopyInto(out *IonosCloudMachineSpec) { } if in.AdditionalNetworks != nil { in, out := &in.AdditionalNetworks, &out.AdditionalNetworks - *out = make(Networks, len(*in)) + *out = make([]Network, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -612,27 +612,6 @@ func (in *Network) DeepCopy() *Network { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in Networks) DeepCopyInto(out *Networks) { - { - in := &in - *out = make(Networks, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Networks. -func (in Networks) DeepCopy() Networks { - if in == nil { - return nil - } - out := new(Networks) - in.DeepCopyInto(out) - return *out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ProvisioningRequest) DeepCopyInto(out *ProvisioningRequest) { *out = *in