@@ -46,6 +46,8 @@ type ParentRefAttachmentStatus struct {
46
46
// still attach. The backendRef condition would be displayed here.
47
47
FailedConditions []conditions.Condition
48
48
// ListenerPort is the port on the Listener that the Route is attached to.
49
+ // FIXME(sarthyparty): https://github.com/nginx/nginx-gateway-fabric/issues/3813
50
+ // Needs to be a map of <gatewayNamespacedName/listenerName> to port number
49
51
ListenerPort v1.PortNumber
50
52
// Attached indicates if the ParentRef is attached to the Gateway.
51
53
Attached bool
@@ -308,7 +310,8 @@ func buildSectionNameRefs(
308
310
}
309
311
310
312
// If there is no section name, handle based on whether port is specified
311
- // FIXME(sarthyparty): this logic seems to be duplicated in findAttachableListeners so we should refactor this,
313
+ // FIXME(sarthyparty): https://github.com/nginx/nginx-gateway-fabric/issues/3811
314
+ // this logic seems to be duplicated in findAttachableListeners so we should refactor this,
312
315
// either here or in findAttachableListeners
313
316
if p .SectionName == nil {
314
317
// If port is specified, preserve the port-only nature for proper validation
@@ -335,7 +338,6 @@ func buildSectionNameRefs(
335
338
Idx : i ,
336
339
Gateway : CreateParentRefGateway (gw ),
337
340
SectionName : & l .Source .Name ,
338
- Port : nil ,
339
341
})
340
342
}
341
343
}
@@ -884,9 +886,11 @@ func findAttachableListeners(ref *ParentRef, listeners []*Listener) ([]*Listener
884
886
if l .Attachable && (ref .Port == nil || l .Source .Port == * ref .Port ) {
885
887
return []* Listener {l }, true
886
888
}
889
+ // We return false because we didn't find a listener that matches the port
887
890
if ref .Port != nil && l .Source .Port != * ref .Port {
888
891
return nil , false
889
892
}
893
+ // Return true because we found a listener that matches the sectionName and port but is not attachable
890
894
return nil , true
891
895
}
892
896
}
0 commit comments