Merge pull request #101690 from fenngwd/fix/ingress_ip_blank

Check IP of Ingress blank before append
This commit is contained in:
Kubernetes Prow Robot 2021-05-13 15:36:05 -07:00 committed by GitHub
commit 24727b5215
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 {