Skip to content

Commit

Permalink
Check for aws status in infra platform status field before client setup
Browse files Browse the repository at this point in the history
We use aws as default implementation for secret annotator. This
causes panic if aws status is nil in infrastucture.Status.PlatformStatus
field.
  • Loading branch information
akhil-rane authored and openshift-cherrypick-robot committed Oct 20, 2021
1 parent 0d83e9b commit 30e9777
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/operator/utils/aws/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ func ClientBuilder(accessKeyID, secretAccessKey []byte, c client.Client) (ccaws.
func setupClientParams(infra *configv1.Infrastructure) *ccaws.ClientParams {
region := ""
endpoint := ""
if infra.Status.PlatformStatus != nil {
// If PlatformStatus isn't nil, then we can at least assume Region is provided
if infra.Status.PlatformStatus != nil && infra.Status.PlatformStatus.AWS != nil {
// If PlatformStatus isn't nil and has AWS status, then we can at least assume Region is provided
region = infra.Status.PlatformStatus.AWS.Region

endpoint = getIAMEndpoint(infra)
Expand Down

0 comments on commit 30e9777

Please sign in to comment.