From d17bae17adc0dcdc4fef94c6e5ce9cad2e1f168c Mon Sep 17 00:00:00 2001 From: Matthias Teich Date: Wed, 28 Aug 2024 10:48:06 +0200 Subject: [PATCH] Fix crds --- api/v1alpha1/zz_generated.deepcopy.go | 2 +- ...tructure.cluster.x-k8s.io_ionoscloudmachines.yaml | 12 ++++++------ ....cluster.x-k8s.io_ionoscloudmachinetemplates.yaml | 12 ++++++------ internal/service/cloud/server.go | 8 ++++---- test/e2e/capic_test.go | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 03121d12..0ad7b4e3 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -589,7 +589,6 @@ func (in *NICInfo) DeepCopy() *NICInfo { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Network) DeepCopyInto(out *Network) { *out = *in - in.IPAMConfig.DeepCopyInto(&out.IPAMConfig) if in.VNET != nil { in, out := &in.VNET, &out.VNET *out = new(string) @@ -600,6 +599,7 @@ func (in *Network) DeepCopyInto(out *Network) { *out = new(bool) **out = **in } + in.IPAMConfig.DeepCopyInto(&out.IPAMConfig) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Network. diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ionoscloudmachines.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ionoscloudmachines.yaml index c5b7a3af..9ecd4eea 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ionoscloudmachines.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ionoscloudmachines.yaml @@ -69,6 +69,12 @@ spec: items: description: Network contains the config for additional LANs. properties: + dhcp: + default: true + description: |- + DHCP indicates whether DHCP is enabled for the LAN. + The primary NIC will always have DHCP enabled. + type: boolean ipv4PoolRef: description: |- IPv4PoolRef is a reference to an IPAMConfig Pool resource, which exposes IPv4 addresses. @@ -127,12 +133,6 @@ spec: rule: self.kind == 'InClusterIPPool' || self.kind == 'GlobalInClusterIPPool' - message: ipv6PoolRef.name is required rule: self.name != '' - dhcp: - default: true - description: |- - DHCP indicates whether DHCP is enabled for the LAN. - The primary NIC will always have DHCP enabled. - type: boolean networkID: description: |- NetworkID represents an ID an existing LAN in the data center. diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_ionoscloudmachinetemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_ionoscloudmachinetemplates.yaml index f28a1844..b672c2ef 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_ionoscloudmachinetemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_ionoscloudmachinetemplates.yaml @@ -79,6 +79,12 @@ spec: description: Network contains the config for additional LANs. properties: + dhcp: + default: true + description: |- + DHCP indicates whether DHCP is enabled for the LAN. + The primary NIC will always have DHCP enabled. + type: boolean ipv4PoolRef: description: |- IPv4PoolRef is a reference to an IPAMConfig Pool resource, which exposes IPv4 addresses. @@ -147,12 +153,6 @@ spec: == 'GlobalInClusterIPPool' - message: ipv6PoolRef.name is required rule: self.name != '' - dhcp: - default: true - description: |- - DHCP indicates whether DHCP is enabled for the LAN. - The primary NIC will always have DHCP enabled. - type: boolean networkID: description: |- NetworkID represents an ID an existing LAN in the data center. diff --git a/internal/service/cloud/server.go b/internal/service/cloud/server.go index 1856c5ab..b24f0c53 100644 --- a/internal/service/cloud/server.go +++ b/internal/service/cloud/server.go @@ -442,10 +442,10 @@ func (s *Service) buildServerEntities(ms *scope.Machine, params serverEntityPara for i, nw := range ms.IonosMachine.Spec.AdditionalNetworks { nic := sdk.Nic{ Properties: &sdk.NicProperties{ - Lan: &nw.NetworkID, - Vnet: nw.VNET, - Dhcp: nw.DHCP, - }, + Lan: &nw.NetworkID, + Vnet: nw.VNET, + Dhcp: nw.DHCP, + }, } if ms.IonosMachine.Status.MachineNetworkInfo != nil { diff --git a/test/e2e/capic_test.go b/test/e2e/capic_test.go index 01a0718c..dea8ccac 100644 --- a/test/e2e/capic_test.go +++ b/test/e2e/capic_test.go @@ -111,7 +111,7 @@ var _ = Describe("Should be able to create a cluster with 1 control-plane using ArtifactFolder: artifactFolder, SkipCleanup: skipCleanup, PostNamespaceCreated: cloudEnv.createCredentialsSecretPNC, - PostMachinesProvisioned: func(managementClusterProxy framework.ClusterProxy, namespace, clusterName string) { + PostMachinesProvisioned: func(managementClusterProxy framework.ClusterProxy, namespace, _ string) { machines := &infrav1.IonosCloudMachineList{} Expect(managementClusterProxy.GetClient().List(ctx, machines, runtimeclient.InNamespace(namespace))).NotTo(HaveOccurred()) nic := machines.Items[0].Status.MachineNetworkInfo.NICInfo[0]