fix router nil bug

This commit is contained in:
Jeff
2019-05-18 09:23:16 +08:00
committed by zryfish
parent ed224612bc
commit 1a1bcfebd0

View File

@@ -112,6 +112,10 @@ func getMasterNodeIp() string {
func addLoadBalancerIp(service *corev1.Service) {
if service == nil {
return
}
// append selected node ip as loadbalancer ingress ip
if service.Spec.Type != corev1.ServiceTypeLoadBalancer && len(service.Status.LoadBalancer.Ingress) == 0 {
rip := getMasterNodeIp()