Skip to content

Commit

Permalink
Merge pull request #169 from openshift-cherrypick-robot/cherry-pick-1…
Browse files Browse the repository at this point in the history
…68-to-release-4.3

Bug 1816704: handle old Infrastructure objects without PlatformStatus
  • Loading branch information
openshift-merge-robot committed Apr 3, 2020
2 parents 88c7f1b + b4c7ff5 commit 02be575
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/controller/utils/utils.go
Expand Up @@ -70,6 +70,12 @@ func LoadInfrastructureRegion(c client.Client, logger log.FieldLogger) (string,
logger.WithError(err).Error("error loading Infrastructure region")
return "", err
}
if infra.Status.PlatformStatus == nil {
// Older clusters may have an Infrastructure object without the PlatformStatus fields.
// Send back an empty region and the AWS client will use default settings.
// The permissions simulation will also simply not fill out the region for simulations.
return "", nil
}
return infra.Status.PlatformStatus.AWS.Region, nil
}

Expand Down

0 comments on commit 02be575

Please sign in to comment.