Skip to content

Commit

Permalink
Merge pull request #352 from MrHohn/default-backend-update
Browse files Browse the repository at this point in the history
Trigger ingress sync on system default backend update
  • Loading branch information
nicksardo authored Jun 20, 2018
2 parents 07ae96d + 3baf017 commit 949c7a8
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 949c7a8

Please sign in to comment.