diff --git a/nginx-controller/controller/utils.go b/nginx-controller/controller/utils.go index 2c57ca7f6d..7d4106ae07 100644 --- a/nginx-controller/controller/utils.go +++ b/nginx-controller/controller/utils.go @@ -117,6 +117,11 @@ func (s *StoreToIngressLister) GetServiceIngress(svc *api.Service) (ings []exten if ing.Namespace != svc.Namespace { continue } + if ing.Spec.Backend != nil { + if ing.Spec.Backend.ServiceName == svc.Name { + ings = append(ings, ing) + } + } for _, rules := range ing.Spec.Rules { if rules.IngressRuleValue.HTTP == nil { continue diff --git a/nginx-plus-controller/controller/utils.go b/nginx-plus-controller/controller/utils.go index 2c57ca7f6d..7d4106ae07 100644 --- a/nginx-plus-controller/controller/utils.go +++ b/nginx-plus-controller/controller/utils.go @@ -117,6 +117,11 @@ func (s *StoreToIngressLister) GetServiceIngress(svc *api.Service) (ings []exten if ing.Namespace != svc.Namespace { continue } + if ing.Spec.Backend != nil { + if ing.Spec.Backend.ServiceName == svc.Name { + ings = append(ings, ing) + } + } for _, rules := range ing.Spec.Rules { if rules.IngressRuleValue.HTTP == nil { continue