Refactor update of status removing initial check for loadbalancer
This commit is contained in:
parent
e82cb31275
commit
55051743fd
3 changed files with 15 additions and 37 deletions
|
|
@ -243,6 +243,11 @@ func (s *statusSync) runningAddresses() ([]string, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
if svc.Spec.Type == apiv1.ServiceTypeExternalName {
|
||||
addrs = append(addrs, svc.Spec.ExternalName)
|
||||
return addrs, nil
|
||||
}
|
||||
|
||||
for _, ip := range svc.Status.LoadBalancer.Ingress {
|
||||
if ip.IP == "" {
|
||||
addrs = append(addrs, ip.Hostname)
|
||||
|
|
|
|||
|
|
@ -45,29 +45,25 @@ func GetNodeIPOrName(kubeClient clientset.Interface, name string, useInternalIP
|
|||
return ""
|
||||
}
|
||||
|
||||
ip := ""
|
||||
|
||||
for _, address := range node.Status.Addresses {
|
||||
if address.Type == apiv1.NodeExternalIP {
|
||||
if address.Address != "" {
|
||||
ip = address.Address
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if useInternalIP {
|
||||
for _, address := range node.Status.Addresses {
|
||||
if address.Type == apiv1.NodeInternalIP {
|
||||
if address.Address != "" {
|
||||
ip = address.Address
|
||||
break
|
||||
return address.Address
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ip
|
||||
for _, address := range node.Status.Addresses {
|
||||
if address.Type == apiv1.NodeExternalIP {
|
||||
if address.Address != "" {
|
||||
return address.Address
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
// PodInfo contains runtime information about the pod running the Ingres controller
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue