nic-6443 commented on code in PR #2804:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/2804#discussion_r3656005782


##########
internal/adc/translator/translator.go:
##########
@@ -66,6 +66,27 @@ func hasExplicitListenerTarget(parentRefs 
[]gatewayv1.ParentReference) bool {
        return false
 }
 
+// collectServerPortMatchPorts returns the set of listener ports that should be
+// enforced through a server_port var.
+//
+// Listeners carrying a hostname are isolated by that hostname (service.hosts),
+// which is the correct discriminator when several listeners share a single 
port.
+// A server_port var adds no isolation for them and actively breaks routing: it
+// pins the route to the Gateway's declared listener port, which need not equal
+// the port APISIX actually accepts the connection on (node_listen), turning
+// every request into a 404. Only hostname-less listeners rely on port-based
+// isolation, so only their ports contribute here.
+func collectServerPortMatchPorts(listeners []gatewayv1.Listener) 
map[int32]struct{} {
+       ports := make(map[int32]struct{})
+       for _, listener := range listeners {
+               if listener.Hostname != nil && *listener.Hostname != "" {

Review Comment:
   [P1] The mixed-listener predicate is fixed, but `auto` remains the default 
while hostname-less listeners still drive injection. With a Gateway listener on 
port 80, APISIX `node_listen` on 9080, and a normal explicit ParentRef, this 
emits `server_port == 80`; the request arrives with 9080 and every route 
misses. The helper comment itself acknowledges that declared and accepted ports 
may differ. Please make this behavior opt-in with a default of `off`, or derive 
the actual data-plane listen port.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to