vsphere: check for nil platform in getIgnitionHost
For UPI workflow installer not set the Vsphere platform [1] when no API / Ingress VIP are provided
by the user as they intend to setup their own load balancing etc.
Therefore we should make sure we check for nil vSphere platform.
[1]:
@@ -333,7 +333,7 @@ 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 != "" {
+ if infraStatus.PlatformStatus.VSphere != nil && infraStatus.PlatformStatus.VSphere.APIServerInternalIP != "" {
ignitionHost = net.JoinHostPort(infraStatus.PlatformStatus.VSphere.APIServerInternalIP, securePortStr)
}
}
