diff --git a/pkg/controller/controller.go b/pkg/controller/controller.go index e9751afcf9..ae9e72c7e2 100644 --- a/pkg/controller/controller.go +++ b/pkg/controller/controller.go @@ -207,7 +207,7 @@ func (lbc *LoadBalancerController) enqueueIngressForObject(obj interface{}) { // enqueueIngressForService enqueues all the Ingresses for a Service. func (lbc *LoadBalancerController) enqueueIngressForService(svc *apiv1.Service) { - ings, err := lbc.ingLister.GetServiceIngress(svc) + ings, err := lbc.ingLister.GetServiceIngress(svc, lbc.CloudClusterManager.defaultBackendSvcPortID) if err != nil { glog.V(5).Infof("ignoring service %v: %v", svc.Name, err) return diff --git a/pkg/controller/utils.go b/pkg/controller/utils.go index 30883e78fd..e2e6f65934 100644 --- a/pkg/controller/utils.go +++ b/pkg/controller/utils.go @@ -93,10 +93,17 @@ func (s *StoreToIngressLister) ListGCEIngresses() (ing extensions.IngressList, e // GetServiceIngress gets all the Ingress' that have rules pointing to a service. // Note that this ignores services without the right nodePorts. -func (s *StoreToIngressLister) GetServiceIngress(svc *api_v1.Service) (ings []extensions.Ingress, err error) { +func (s *StoreToIngressLister) GetServiceIngress(svc *api_v1.Service, systemDefaultBackend utils.ServicePortID) (ings []extensions.Ingress, err error) { IngressLoop: for _, m := range s.Store.List() { ing := *m.(*extensions.Ingress) + + // Check if system default backend is involved + if ing.Spec.Backend == nil && systemDefaultBackend.Service.Name == svc.Name && systemDefaultBackend.Service.Namespace == svc.Namespace { + ings = append(ings, ing) + continue + } + if ing.Namespace != svc.Namespace { continue }