Return correct node address
This commit is contained in:
parent
77967aa15f
commit
3873042669
1 changed files with 5 additions and 4 deletions
|
@ -211,13 +211,14 @@ func (s *statusSync) runningAddresess() ([]string, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
ips := []string{}
|
addrs := []string{}
|
||||||
for _, pod := range pods.Items {
|
for _, pod := range pods.Items {
|
||||||
if !strings.StringInSlice(pod.Status.HostIP, ips) {
|
name := k8s.GetNodeIP(s.Client, pod.Spec.NodeName)
|
||||||
ips = append(ips, pod.Status.HostIP)
|
if !strings.StringInSlice(name, addrs) {
|
||||||
|
addrs = append(addrs, name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ips, nil
|
return addrs, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// sliceToStatus converts a slice of IP and/or hostnames to LoadBalancerIngress
|
// sliceToStatus converts a slice of IP and/or hostnames to LoadBalancerIngress
|
||||||
|
|
Loading…
Reference in a new issue