Check IP of Ingress blank before append

This commit is contained in:
Weidong Feng 2021-05-01 18:54:35 +08:00
parent 0c112347ca
commit 63f9b392b5

View File

@ -201,7 +201,9 @@ func (sct *ServiceChangeTracker) newBaseServiceInfo(port *v1.ServicePort, servic
// Obtain Load Balancer Ingress IPs
var ips []string
for _, ing := range service.Status.LoadBalancer.Ingress {
ips = append(ips, ing.IP)
if ing.IP != "" {
ips = append(ips, ing.IP)
}
}
if len(ips) > 0 {