Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger ingress sync on system default backend update #352

Merged
merged 1 commit into from
Jun 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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