Skip to content

Commit

Permalink
Merge pull request #367 from openshift-cherrypick-robot/cherry-pick-3…
Browse files Browse the repository at this point in the history
…63-to-release-4.12

[release-4.12] OCPBUGS-19557: Guard against nil PlatformStatus
  • Loading branch information
openshift-merge-robot committed Sep 27, 2023
2 parents 19f84ba + d0a3a87 commit 5f4795c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions provisioning/utils.go
Expand Up @@ -68,10 +68,19 @@ func getServerInternalIP(osclient osclientset.Interface) (string, error) {
// FIXME(dtantsur): handle the new APIServerInternalIPs field and the dualstack case.
switch infra.Status.PlatformStatus.Type {
case osconfigv1.BareMetalPlatformType:
if infra.Status.PlatformStatus == nil || infra.Status.PlatformStatus.BareMetal == nil {
return "", nil
}
return infra.Status.PlatformStatus.BareMetal.APIServerInternalIP, nil
case osconfigv1.OpenStackPlatformType:
if infra.Status.PlatformStatus == nil || infra.Status.PlatformStatus.OpenStack == nil {
return "", nil
}
return infra.Status.PlatformStatus.OpenStack.APIServerInternalIP, nil
case osconfigv1.VSpherePlatformType:
if infra.Status.PlatformStatus == nil || infra.Status.PlatformStatus.VSphere == nil {
return "", nil
}
return infra.Status.PlatformStatus.VSphere.APIServerInternalIP, nil
case osconfigv1.AWSPlatformType:
return "", nil
Expand Down

0 comments on commit 5f4795c

Please sign in to comment.