Skip to content

Commit

Permalink
Merge pull request #9317 from miyamotoh/override-resourcemanager-endp…
Browse files Browse the repository at this point in the history
…oint

OCPBUGS-46470: Power VS: ResourceManager also to override for Internal deploy
  • Loading branch information
openshift-merge-bot[bot] authored Dec 19, 2024
2 parents 27fa766 + 511bd2f commit ec72ce6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
13 changes: 7 additions & 6 deletions pkg/asset/installconfig/powervs/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/asset/installconfig/powervs/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion pkg/asset/manifests/infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions pkg/asset/manifests/powervs/cloudproviderconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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):
Expand Down Expand Up @@ -90,6 +94,7 @@ func CloudProviderConfig(infraID string, accountID string, vpcName string, regio
IamEndpointOverride: iamEndpointOverride,
PowerVSEndpointOverride: powerVSEndpointOverride,
RcEndpointOverride: rcEndpointOverride,
RmEndpointOverride: rmEndpointOverride,
},
}
buf := &bytes.Buffer{}
Expand Down Expand Up @@ -122,4 +127,5 @@ g2EndpointOverride = {{.Provider.G2EndpointOverride}}
iamEndpointOverride = {{.Provider.IamEndpointOverride}}
powerVSEndpointOverride = {{.Provider.PowerVSEndpointOverride}}
rcEndpointOverride = {{.Provider.RcEndpointOverride}}
rmEndpointOverride = {{.Provider.RmEndpointOverride}}
`

0 comments on commit ec72ce6

Please sign in to comment.