Skip to content

Commit 0199908

Browse files
tangle329pleshakov
authored andcommitted
Fix issue when operate Single Service Ingress backend
Signed-off-by: Tang Le <[email protected]>
1 parent 63321b3 commit 0199908

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

nginx-controller/controller/utils.go

+5
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ func (s *StoreToIngressLister) GetServiceIngress(svc *api.Service) (ings []exten
117117
if ing.Namespace != svc.Namespace {
118118
continue
119119
}
120+
if ing.Spec.Backend != nil {
121+
if ing.Spec.Backend.ServiceName == svc.Name {
122+
ings = append(ings, ing)
123+
}
124+
}
120125
for _, rules := range ing.Spec.Rules {
121126
if rules.IngressRuleValue.HTTP == nil {
122127
continue

nginx-plus-controller/controller/utils.go

+5
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ func (s *StoreToIngressLister) GetServiceIngress(svc *api.Service) (ings []exten
117117
if ing.Namespace != svc.Namespace {
118118
continue
119119
}
120+
if ing.Spec.Backend != nil {
121+
if ing.Spec.Backend.ServiceName == svc.Name {
122+
ings = append(ings, ing)
123+
}
124+
}
120125
for _, rules := range ing.Spec.Rules {
121126
if rules.IngressRuleValue.HTTP == nil {
122127
continue

0 commit comments

Comments
 (0)