Skip to content

Commit 6600b89

Browse files
Merge pull request #987 from hamzy/PowerVS-update-supported-regions
OCPBUGS-26767: MULTIARCH-4074: PowerVS: update supported regions
2 parents 3f33142 + 153a10b commit 6600b89

File tree

10 files changed

+432
-67
lines changed

10 files changed

+432
-67
lines changed

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ require (
3636
github.com/openshift/build-machinery-go v0.0.0-20230816154005-5a38e1bfd880
3737
github.com/openshift/client-go v0.0.0-20231018150822-6e226e2825a6
3838
github.com/openshift/library-go v0.0.0-20231020125034-5a2d9fe760b3
39+
github.com/ppc64le-cloud/powervs-utils v0.0.0-20240105123432-7588e9595c17
3940
github.com/prometheus/client_golang v1.16.0
4041
github.com/prometheus/client_model v0.4.0
4142
github.com/prometheus/common v0.44.0

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -954,6 +954,8 @@ github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZ
954954
github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg=
955955
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
956956
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
957+
github.com/ppc64le-cloud/powervs-utils v0.0.0-20240105123432-7588e9595c17 h1:4Hd7ppyxQE648qShgm62PNXehIOMSOZR0V9zySJEgzE=
958+
github.com/ppc64le-cloud/powervs-utils v0.0.0-20240105123432-7588e9595c17/go.mod h1:KImYgHmvBVtAczNhyDBDSN54PGIdz0+QiPVQMmObEQY=
957959
github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8=
958960
github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc=
959961
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=

pkg/storage/ibmcos/ibmcos.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import (
3838
"github.com/openshift/cluster-image-registry-operator/pkg/envvar"
3939
"github.com/openshift/cluster-image-registry-operator/pkg/storage/util"
4040
"github.com/openshift/cluster-image-registry-operator/pkg/version"
41+
powerUtils "github.com/ppc64le-cloud/powervs-utils"
4142
)
4243

4344
const (
@@ -134,7 +135,7 @@ func (d *driver) UpdateEffectiveConfig() (*imageregistryv1.ImageRegistryConfigSt
134135
clusterLocation = infra.Status.PlatformStatus.IBMCloud.Location
135136
}
136137
if infra.Status.PlatformStatus.Type == configapiv1.PowerVSPlatformType && infra.Status.PlatformStatus.PowerVS != nil {
137-
clusterLocation, err = cosRegionForPowerVSRegion(infra.Status.PlatformStatus.PowerVS.Region)
138+
clusterLocation, err = powerUtils.COSRegionForPowerVSRegion(infra.Status.PlatformStatus.PowerVS.Region)
138139
if err != nil {
139140
return nil, err
140141
}
@@ -168,7 +169,7 @@ func (d *driver) CreateStorage(cr *imageregistryv1.Config) error {
168169
d.Config.ResourceGroupName = infra.Status.PlatformStatus.IBMCloud.ResourceGroupName
169170
}
170171
if infra.Status.PlatformStatus.Type == configapiv1.PowerVSPlatformType && infra.Status.PlatformStatus.PowerVS != nil {
171-
d.Config.Location, err = cosRegionForPowerVSRegion(infra.Status.PlatformStatus.PowerVS.Region)
172+
d.Config.Location, err = powerUtils.COSRegionForPowerVSRegion(infra.Status.PlatformStatus.PowerVS.Region)
172173
if err != nil {
173174
return err
174175
}
@@ -782,7 +783,7 @@ func (d *driver) getIBMCOSClient(serviceInstanceCRN string) (*s3.S3, error) {
782783
IBMCOSLocation = infra.Status.PlatformStatus.IBMCloud.Location
783784
}
784785
if infra.Status.PlatformStatus.Type == configapiv1.PowerVSPlatformType && infra.Status.PlatformStatus.PowerVS != nil {
785-
IBMCOSLocation, err = cosRegionForPowerVSRegion(infra.Status.PlatformStatus.PowerVS.Region)
786+
IBMCOSLocation, err = powerUtils.COSRegionForPowerVSRegion(infra.Status.PlatformStatus.PowerVS.Region)
786787
if err != nil {
787788
return nil, err
788789
}

pkg/storage/ibmcos/powervs_regions.go

Lines changed: 0 additions & 64 deletions
This file was deleted.

vendor/github.com/ppc64le-cloud/powervs-utils/.gitignore

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/ppc64le-cloud/powervs-utils/LICENSE

Lines changed: 201 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/ppc64le-cloud/powervs-utils/OWNERS

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/ppc64le-cloud/powervs-utils/README.md

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)