mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-22 02:18:51 +00:00
@@ -166,16 +166,17 @@ func (sct *ServiceChangeTracker) newBaseServiceInfo(port *v1.ServicePort, servic
|
||||
// Obtain Load Balancer Ingress IPs
|
||||
var allIncorrectIPs []string
|
||||
for _, ing := range service.Status.LoadBalancer.Ingress {
|
||||
// []string{ing.IP} have a len of 1, so len(correctIPs) + len(incorrectIPs) == 1
|
||||
correctIPs, incorrectIPs := utilproxy.FilterIncorrectIPVersion([]string{ing.IP}, sct.ipFamily)
|
||||
|
||||
// len is either 1 or 0
|
||||
if len(correctIPs) == 1 {
|
||||
// Update the LoadBalancerStatus with the filtered IPs
|
||||
// Update the LoadBalancerStatus with the filtered IP
|
||||
info.loadBalancerStatus.Ingress = append(info.loadBalancerStatus.Ingress, ing)
|
||||
continue
|
||||
}
|
||||
|
||||
// here len(incorrectIPs) == 1
|
||||
// here len(incorrectIPs) == 1 since len(correctIPs) == 0
|
||||
allIncorrectIPs = append(allIncorrectIPs, incorrectIPs[0])
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user