Skip to content

Commit

Permalink
Merge pull request #2865 from jcpowermac/bz2031049
Browse files Browse the repository at this point in the history
Bug 2031049: Fix panic when PlatformStatus VSphere is nil
  • Loading branch information
openshift-merge-robot authored Dec 17, 2021
2 parents 21c26e7 + 3f0b397 commit 0476b25
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/operator/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,12 @@ func getIgnitionHost(infraStatus *configv1.InfrastructureStatus) (string, error)
case configv1.OvirtPlatformType:
ignitionHost = net.JoinHostPort(infraStatus.PlatformStatus.Ovirt.APIServerInternalIP, securePortStr)
case configv1.VSpherePlatformType:
if infraStatus.PlatformStatus.VSphere.APIServerInternalIP != "" {
ignitionHost = net.JoinHostPort(infraStatus.PlatformStatus.VSphere.APIServerInternalIP, securePortStr)
if infraStatus.PlatformStatus.VSphere != nil {
if infraStatus.PlatformStatus.VSphere.APIServerInternalIP != "" {
ignitionHost = net.JoinHostPort(infraStatus.PlatformStatus.VSphere.APIServerInternalIP, securePortStr)
}
} else {
glog.Warning("Warning: PlatformStatus.VSphere should not be nil")
}
}
}
Expand Down

0 comments on commit 0476b25

Please sign in to comment.