Skip to content

Commit cd01bd5

Browse files
committed
PowerVS: Fix COS region
We should be passing in a translated VPC region for the COS bucket.
1 parent 6bb3cae commit cd01bd5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pkg/asset/manifests/powervs/cluster.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ func GenerateClusterAssets(installConfig *installconfig.InstallConfig, clusterID
2525
vpcRegion string
2626
transitGatewayName string
2727
cosName string
28+
cosRegion string
2829
imageName string
2930
bucketName string
3031
err error
@@ -40,6 +41,7 @@ func GenerateClusterAssets(installConfig *installconfig.InstallConfig, clusterID
4041
logrus.Debugf("GenerateClusterAssets: vpcRegion = %v", vpcRegion)
4142
logrus.Debugf("GenerateClusterAssets: transitGatewayName = %v", transitGatewayName)
4243
logrus.Debugf("GenerateClusterAssets: cosName = %v", cosName)
44+
logrus.Debugf("GenerateClusterAssets: cosRegion = %v", cosRegion)
4345
logrus.Debugf("GenerateClusterAssets: imageName = %v", imageName)
4446
logrus.Debugf("GenerateClusterAssets: bucketName = %v", bucketName)
4547
logrus.Debugf("GenerateClusterAssets: powerVSCluster.Spec.ControlPlaneEndpoint.Host = %v", powerVSCluster.Spec.ControlPlaneEndpoint.Host)
@@ -77,6 +79,10 @@ func GenerateClusterAssets(installConfig *installconfig.InstallConfig, clusterID
7779

7880
cosName = fmt.Sprintf("%s-cos", clusterID.InfraID)
7981

82+
if cosRegion, err = powervstypes.COSRegionForPowerVSRegion(installConfig.Config.PowerVS.Region); err != nil {
83+
return nil, fmt.Errorf("unable to derive cosRegion from region: %s %w", installConfig.Config.PowerVS.Region, err)
84+
}
85+
8086
imageName = fmt.Sprintf("rhcos-%s", clusterID.InfraID)
8187

8288
bucketName = fmt.Sprintf("%s-bootstrap-ign", clusterID.InfraID)
@@ -140,7 +146,7 @@ func GenerateClusterAssets(installConfig *installconfig.InstallConfig, clusterID
140146
CosInstance: &capibm.CosInstance{
141147
Name: cosName,
142148
BucketName: bucketName,
143-
BucketRegion: vpcRegion,
149+
BucketRegion: cosRegion,
144150
},
145151
Ignition: &capibm.Ignition{
146152
Version: "3.4",
@@ -181,7 +187,7 @@ func GenerateClusterAssets(installConfig *installconfig.InstallConfig, clusterID
181187
ServiceInstance: &service,
182188
Bucket: &bucket,
183189
Object: &object,
184-
Region: &vpcRegion,
190+
Region: &cosRegion,
185191
},
186192
}
187193

0 commit comments

Comments
 (0)