Skip to content

Commit

Permalink
Trigger ingress sync on system default backend update
Browse files Browse the repository at this point in the history
  • Loading branch information
MrHohn committed Jun 20, 2018
1 parent b7ed7a2 commit 3baf017
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion pkg/controller/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 3baf017

Please sign in to comment.