@@ -112,10 +112,10 @@ func (d *driver) UpdateEffectiveConfig() (*imageregistryv1.ImageRegistryConfigSt
112
112
113
113
var clusterLocation string
114
114
if infra .Status .PlatformStatus != nil {
115
- if infra .Status .PlatformStatus .Type == configapiv1 .IBMCloudPlatformType {
115
+ if infra .Status .PlatformStatus .Type == configapiv1 .IBMCloudPlatformType && infra . Status . PlatformStatus . IBMCloud != nil {
116
116
clusterLocation = infra .Status .PlatformStatus .IBMCloud .Location
117
117
}
118
- if infra .Status .PlatformStatus .Type == configapiv1 .PowerVSPlatformType {
118
+ if infra .Status .PlatformStatus .Type == configapiv1 .PowerVSPlatformType && infra . Status . PlatformStatus . PowerVS != nil {
119
119
clusterLocation , err = cosRegionForPowerVSRegion (infra .Status .PlatformStatus .PowerVS .Region )
120
120
if err != nil {
121
121
return nil , err
@@ -144,11 +144,11 @@ func (d *driver) CreateStorage(cr *imageregistryv1.Config) error {
144
144
145
145
// Set configs from Infrastructure
146
146
if infra .Status .PlatformStatus != nil {
147
- if infra .Status .PlatformStatus .Type == configapiv1 .IBMCloudPlatformType {
147
+ if infra .Status .PlatformStatus .Type == configapiv1 .IBMCloudPlatformType && infra . Status . PlatformStatus . IBMCloud != nil {
148
148
d .Config .Location = infra .Status .PlatformStatus .IBMCloud .Location
149
149
d .Config .ResourceGroupName = infra .Status .PlatformStatus .IBMCloud .ResourceGroupName
150
150
}
151
- if infra .Status .PlatformStatus .Type == configapiv1 .PowerVSPlatformType {
151
+ if infra .Status .PlatformStatus .Type == configapiv1 .PowerVSPlatformType && infra . Status . PlatformStatus . PowerVS != nil {
152
152
d .Config .Location , err = cosRegionForPowerVSRegion (infra .Status .PlatformStatus .PowerVS .Region )
153
153
if err != nil {
154
154
return err
@@ -692,10 +692,10 @@ func (d *driver) getIBMCOSClient(serviceInstanceCRN string) (*s3.S3, error) {
692
692
693
693
IBMCOSLocation := imageregistryv1.ImageRegistryConfigStorageIBMCOS {}.Location
694
694
if infra .Status .PlatformStatus != nil {
695
- if infra .Status .PlatformStatus .Type == configapiv1 .IBMCloudPlatformType {
695
+ if infra .Status .PlatformStatus .Type == configapiv1 .IBMCloudPlatformType && infra . Status . PlatformStatus . IBMCloud != nil {
696
696
IBMCOSLocation = infra .Status .PlatformStatus .IBMCloud .Location
697
697
}
698
- if infra .Status .PlatformStatus .Type == configapiv1 .PowerVSPlatformType {
698
+ if infra .Status .PlatformStatus .Type == configapiv1 .PowerVSPlatformType && infra . Status . PlatformStatus . PowerVS != nil {
699
699
IBMCOSLocation , err = cosRegionForPowerVSRegion (infra .Status .PlatformStatus .PowerVS .Region )
700
700
if err != nil {
701
701
return nil , err
0 commit comments