Refactor update of status removing initial check for loadbalancer

This commit is contained in:
Manuel de Brito Fontes 2018-05-13 09:38:30 -04:00
parent e82cb31275
commit 55051743fd
3 changed files with 15 additions and 37 deletions

View file

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