From 511bd2f795c0da8fe9a5d711c2257635c46e4d70 Mon Sep 17 00:00:00 2001 From: Hiro Miyamoto Date: Fri, 13 Dec 2024 14:57:08 -0500 Subject: [PATCH] ResourceManager also to override for Internal deploy Signed-off-by: Hiro Miyamoto --- pkg/asset/installconfig/powervs/metadata.go | 13 +++++++------ pkg/asset/installconfig/powervs/session.go | 2 +- pkg/asset/manifests/infrastructure.go | 2 +- pkg/asset/manifests/powervs/cloudproviderconfig.go | 6 ++++++ 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/pkg/asset/installconfig/powervs/metadata.go b/pkg/asset/installconfig/powervs/metadata.go index 70df86adfc7..2c527baa813 100644 --- a/pkg/asset/installconfig/powervs/metadata.go +++ b/pkg/asset/installconfig/powervs/metadata.go @@ -504,12 +504,13 @@ func leftInContext(ctx context.Context) time.Duration { // SetDefaultPrivateServiceEndpoints sets service endpoint overrides as needed for Disconnected install. func (m *Metadata) SetDefaultPrivateServiceEndpoints(ctx context.Context, overrides []configv1.PowerVSServiceEndpoint, cosRegion string, vpcRegion string) []configv1.PowerVSServiceEndpoint { - overrides = addOverride(overrides, "COS", fmt.Sprintf("https://s3.direct.%s.cloud-object-storage.appdomain.cloud", cosRegion)) - overrides = addOverride(overrides, "DNSServices", "https://api.private.dns-svcs.cloud.ibm.com") - overrides = addOverride(overrides, "IAM", "https://private.iam.cloud.ibm.com") - overrides = addOverride(overrides, "Power", fmt.Sprintf("https://private.%s.power-iaas.cloud.ibm.com", vpcRegion)) - overrides = addOverride(overrides, "ResourceController", "https://private.resource-controller.cloud.ibm.com") - overrides = addOverride(overrides, "VPC", fmt.Sprintf("https://%s.private.iaas.cloud.ibm.com", vpcRegion)) + overrides = addOverride(overrides, string(configv1.IBMCloudServiceCOS), fmt.Sprintf("https://s3.direct.%s.cloud-object-storage.appdomain.cloud", cosRegion)) + overrides = addOverride(overrides, string(configv1.IBMCloudServiceDNSServices), "https://api.private.dns-svcs.cloud.ibm.com") + overrides = addOverride(overrides, string(configv1.IBMCloudServiceIAM), "https://private.iam.cloud.ibm.com") + overrides = addOverride(overrides, "Power", fmt.Sprintf("https://private.%s.power-iaas.cloud.ibm.com", vpcRegion)) // FIXME confiv1.IBMCloudServicePower? + overrides = addOverride(overrides, string(configv1.IBMCloudServiceResourceController), "https://private.resource-controller.cloud.ibm.com") + overrides = addOverride(overrides, string(configv1.IBMCloudServiceResourceManager), "https://private.resource-controller.cloud.ibm.com") + overrides = addOverride(overrides, string(configv1.IBMCloudServiceVPC), fmt.Sprintf("https://%s.private.iaas.cloud.ibm.com", vpcRegion)) return overrides } diff --git a/pkg/asset/installconfig/powervs/session.go b/pkg/asset/installconfig/powervs/session.go index 9f61b6741f1..9dc0d708b6f 100644 --- a/pkg/asset/installconfig/powervs/session.go +++ b/pkg/asset/installconfig/powervs/session.go @@ -434,7 +434,7 @@ func (c *BxClient) MapServiceEndpointsForCAPI(cfg *powervs.Metadata) []string { "COS": "cos", "Power": "powervs", "ResourceController": "", // FIXME CAPI recognizes "rc," but crashes if passed in... - "ResourceManager": "rm", + "ResourceManager": "", // FIXME? masters unable to get their ignition if "rm" override is present... "VPC": "vpc", } overrides := make([]string, 0, len(cfg.ServiceEndpoints)) diff --git a/pkg/asset/manifests/infrastructure.go b/pkg/asset/manifests/infrastructure.go index 3d01b4ac7ea..751f4e990ac 100644 --- a/pkg/asset/manifests/infrastructure.go +++ b/pkg/asset/manifests/infrastructure.go @@ -330,7 +330,7 @@ func (i *Infrastructure) Generate(ctx context.Context, dependencies asset.Parent ResourceGroup: installConfig.Config.Platform.PowerVS.PowerVSResourceGroup, CISInstanceCRN: cisInstanceCRN, DNSInstanceCRN: dnsInstanceCRN, - ServiceEndpoints: installConfig.Config.Platform.PowerVS.ServiceEndpoints, + ServiceEndpoints: config.Spec.PlatformSpec.PowerVS.ServiceEndpoints, } case nutanix.Name: config.Spec.PlatformSpec.Type = configv1.NutanixPlatformType diff --git a/pkg/asset/manifests/powervs/cloudproviderconfig.go b/pkg/asset/manifests/powervs/cloudproviderconfig.go index 33b576637ad..b5ee14dd9bf 100644 --- a/pkg/asset/manifests/powervs/cloudproviderconfig.go +++ b/pkg/asset/manifests/powervs/cloudproviderconfig.go @@ -43,6 +43,7 @@ type provider struct { IamEndpointOverride string `gcfg:"iamEndpointOverride"` PowerVSEndpointOverride string `gcfg:"powerVSEndpointOverride"` RcEndpointOverride string `gcfg:"rcEndpointOverride"` + RmEndpointOverride string `gcfg:"rmEndpointOverride"` } // CloudProviderConfig generates the cloud provider config for the IBM Power VS platform. @@ -51,12 +52,15 @@ func CloudProviderConfig(infraID string, accountID string, vpcName string, regio rcEndpointOverride := "" powerVSEndpointOverride := "" vpcEndpointOverride := "" + rmEndpointOverride := "" for _, endpoint := range endpointOverrides { switch endpoint.Name { case string(configv1.IBMCloudServiceIAM): iamEndpointOverride = endpoint.URL case string(configv1.IBMCloudServiceResourceController): rcEndpointOverride = endpoint.URL + case string(configv1.IBMCloudServiceResourceManager): + rmEndpointOverride = endpoint.URL case "Power": // FIXME configv1.IBMCloudServicePower? powerVSEndpointOverride = endpoint.URL case string(configv1.IBMCloudServiceVPC): @@ -90,6 +94,7 @@ func CloudProviderConfig(infraID string, accountID string, vpcName string, regio IamEndpointOverride: iamEndpointOverride, PowerVSEndpointOverride: powerVSEndpointOverride, RcEndpointOverride: rcEndpointOverride, + RmEndpointOverride: rmEndpointOverride, }, } buf := &bytes.Buffer{} @@ -122,4 +127,5 @@ g2EndpointOverride = {{.Provider.G2EndpointOverride}} iamEndpointOverride = {{.Provider.IamEndpointOverride}} powerVSEndpointOverride = {{.Provider.PowerVSEndpointOverride}} rcEndpointOverride = {{.Provider.RcEndpointOverride}} +rmEndpointOverride = {{.Provider.RmEndpointOverride}} `