Return correct node address

This commit is contained in:
Manuel de Brito Fontes 2016-12-16 14:56:27 -03:00
parent 77967aa15f
commit 3873042669

View file

@ -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