From 11abb80eb0182de6e5963fb9d191cfb9a0479e51 Mon Sep 17 00:00:00 2001 From: vr4manta Date: Wed, 10 Dec 2025 14:00:44 -0500 Subject: [PATCH 1/2] Added ability to install different IPAM version when in TP. --- pkg/asset/machines/vsphere/machines.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkg/asset/machines/vsphere/machines.go b/pkg/asset/machines/vsphere/machines.go index 2ef0018efe8..b0f9074fec2 100644 --- a/pkg/asset/machines/vsphere/machines.go +++ b/pkg/asset/machines/vsphere/machines.go @@ -15,6 +15,7 @@ import ( ipamv1 "sigs.k8s.io/cluster-api/api/ipam/v1beta1" //nolint:staticcheck //CORS-3563 v1 "github.com/openshift/api/config/v1" + "github.com/openshift/api/features" machinev1 "github.com/openshift/api/machine/v1" machineapi "github.com/openshift/api/machine/v1beta1" "github.com/openshift/installer/pkg/types" @@ -146,6 +147,17 @@ func Machines(clusterID string, config *types.InstallConfig, pool *types.Machine if err != nil { return data, err } else if claim != nil && address != nil { + // To prevent having to touch many function below, adding logic here to ClusterCAPI issue with v1beta1 vs v1beta2. + // If cluster capi operator is enabled, we need to support v1beta2 of the IPAM. If disabled, we can keep v1beta1. + if config.EnabledFeatureGates().Enabled(features.FeatureGateClusterAPIMachineManagement) { + fmt.Println("Processing api update") + for index := range claim { + claim[index].APIVersion = "ipam.cluster.x-k8s.io/v1beta2" + } + for index := range address { + address[index].APIVersion = "ipam.cluster.x-k8s.io/v1beta2" + } + } data.IPClaims = append(data.IPClaims, claim...) data.IPAddresses = append(data.IPAddresses, address...) } From f136b971113c5af020974a4dfbd63c4d99a1b46e Mon Sep 17 00:00:00 2001 From: Joseph Callen Date: Wed, 17 Dec 2025 07:30:09 -0500 Subject: [PATCH 2/2] Remove fmt println with logrus debug --- pkg/asset/machines/vsphere/machines.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/asset/machines/vsphere/machines.go b/pkg/asset/machines/vsphere/machines.go index b0f9074fec2..08a2b9944a1 100644 --- a/pkg/asset/machines/vsphere/machines.go +++ b/pkg/asset/machines/vsphere/machines.go @@ -150,7 +150,7 @@ func Machines(clusterID string, config *types.InstallConfig, pool *types.Machine // To prevent having to touch many function below, adding logic here to ClusterCAPI issue with v1beta1 vs v1beta2. // If cluster capi operator is enabled, we need to support v1beta2 of the IPAM. If disabled, we can keep v1beta1. if config.EnabledFeatureGates().Enabled(features.FeatureGateClusterAPIMachineManagement) { - fmt.Println("Processing api update") + logrus.Debug("updating capi ipam apiVersion from v1beta1 to v1beta2 when feature gate ClusterAPIMachineManagement is enabled") for index := range claim { claim[index].APIVersion = "ipam.cluster.x-k8s.io/v1beta2" }