From 6a973ea1f10e64bf86ff97319b57d0ff6399752c Mon Sep 17 00:00:00 2001 From: Anshul Verma Date: Mon, 27 May 2024 10:19:19 +0530 Subject: [PATCH] [BUGFIX] This is to fix the cluster installation failure when preconfigured NSGs used (#3591) * changed the api functions to properly set the NetworkProfile.PreconfiguredNSG field * changed for the admin api as well * make generate fixed --- pkg/api/admin/openshiftcluster_convert.go | 1 + pkg/api/v20230904/openshiftcluster_convert.go | 1 + pkg/api/v20231122/openshiftcluster_convert.go | 1 + pkg/api/v20240812preview/openshiftcluster_convert.go | 1 + 4 files changed, 4 insertions(+) diff --git a/pkg/api/admin/openshiftcluster_convert.go b/pkg/api/admin/openshiftcluster_convert.go index b0a563bcf6a..e91a2a46c0f 100644 --- a/pkg/api/admin/openshiftcluster_convert.go +++ b/pkg/api/admin/openshiftcluster_convert.go @@ -305,6 +305,7 @@ func (c openShiftClusterConverter) ToInternal(_oc interface{}, out *api.OpenShif out.Properties.NetworkProfile.APIServerPrivateEndpointIP = oc.Properties.NetworkProfile.APIServerPrivateEndpointIP out.Properties.NetworkProfile.GatewayPrivateEndpointIP = oc.Properties.NetworkProfile.GatewayPrivateEndpointIP out.Properties.NetworkProfile.GatewayPrivateLinkID = oc.Properties.NetworkProfile.GatewayPrivateLinkID + out.Properties.NetworkProfile.PreconfiguredNSG = api.PreconfiguredNSG(oc.Properties.NetworkProfile.PreconfiguredNSG) if oc.Properties.NetworkProfile.LoadBalancerProfile != nil { loadBalancerProfile := api.LoadBalancerProfile{} diff --git a/pkg/api/v20230904/openshiftcluster_convert.go b/pkg/api/v20230904/openshiftcluster_convert.go index fd8069d554d..5bfbf0bbd66 100644 --- a/pkg/api/v20230904/openshiftcluster_convert.go +++ b/pkg/api/v20230904/openshiftcluster_convert.go @@ -169,6 +169,7 @@ func (c openShiftClusterConverter) ToInternal(_oc interface{}, out *api.OpenShif out.Properties.NetworkProfile.PodCIDR = oc.Properties.NetworkProfile.PodCIDR out.Properties.NetworkProfile.ServiceCIDR = oc.Properties.NetworkProfile.ServiceCIDR out.Properties.NetworkProfile.OutboundType = api.OutboundType(oc.Properties.NetworkProfile.OutboundType) + out.Properties.NetworkProfile.PreconfiguredNSG = api.PreconfiguredNSG(oc.Properties.NetworkProfile.PreconfiguredNSG) out.Properties.MasterProfile.VMSize = api.VMSize(oc.Properties.MasterProfile.VMSize) out.Properties.MasterProfile.SubnetID = oc.Properties.MasterProfile.SubnetID out.Properties.MasterProfile.EncryptionAtHost = api.EncryptionAtHost(oc.Properties.MasterProfile.EncryptionAtHost) diff --git a/pkg/api/v20231122/openshiftcluster_convert.go b/pkg/api/v20231122/openshiftcluster_convert.go index 53c89d1da91..59a2037c251 100644 --- a/pkg/api/v20231122/openshiftcluster_convert.go +++ b/pkg/api/v20231122/openshiftcluster_convert.go @@ -190,6 +190,7 @@ func (c openShiftClusterConverter) ToInternal(_oc interface{}, out *api.OpenShif out.Properties.NetworkProfile.PodCIDR = oc.Properties.NetworkProfile.PodCIDR out.Properties.NetworkProfile.ServiceCIDR = oc.Properties.NetworkProfile.ServiceCIDR out.Properties.NetworkProfile.OutboundType = api.OutboundType(oc.Properties.NetworkProfile.OutboundType) + out.Properties.NetworkProfile.PreconfiguredNSG = api.PreconfiguredNSG(oc.Properties.NetworkProfile.PreconfiguredNSG) if oc.Properties.NetworkProfile.LoadBalancerProfile != nil { loadBalancerProfile := api.LoadBalancerProfile{} diff --git a/pkg/api/v20240812preview/openshiftcluster_convert.go b/pkg/api/v20240812preview/openshiftcluster_convert.go index ad51f440659..1d6ab240a1c 100644 --- a/pkg/api/v20240812preview/openshiftcluster_convert.go +++ b/pkg/api/v20240812preview/openshiftcluster_convert.go @@ -238,6 +238,7 @@ func (c openShiftClusterConverter) ToInternal(_oc interface{}, out *api.OpenShif out.Properties.NetworkProfile.PodCIDR = oc.Properties.NetworkProfile.PodCIDR out.Properties.NetworkProfile.ServiceCIDR = oc.Properties.NetworkProfile.ServiceCIDR out.Properties.NetworkProfile.OutboundType = api.OutboundType(oc.Properties.NetworkProfile.OutboundType) + out.Properties.NetworkProfile.PreconfiguredNSG = api.PreconfiguredNSG(oc.Properties.NetworkProfile.PreconfiguredNSG) if oc.Properties.NetworkProfile.LoadBalancerProfile != nil { loadBalancerProfile := api.LoadBalancerProfile{}