AlinsRan opened a new pull request, #2819:
URL: https://github.com/apache/apisix-ingress-controller/pull/2819

   ### Problem
   
   The Gateway API `HTTPRouteNoBackendRefs` conformance test requires a rule 
with omitted or empty `backendRefs` to explicitly respond with **500**. 
Currently such requests return **404** (verified failing in both `apisix` and 
`apisix-standalone` conformance jobs).
   
   ### Root cause
   
   `translateBackendsToUpstreams` only injects the fault-injection 500 plugin 
when a backendRef *fails to resolve* (`backendErr != nil`). When a rule has 
**no** backendRefs, the loop never runs, `backendErr` stays `nil`, the service 
gets an empty upstream, and requests fall through to 404.
   
   Confirmed by dumping the translator output: `NoBackendRefs` produces an 
empty upstream with **no** fault-injection, whereas the already-passing 
`NonExistent`/`UnknownKind` cases produce fault-injection 500 over the same 
empty upstream.
   
   ### Fix
   
   Inject the fault-injection 500 also when the rule carries no backendRefs. A 
backend that resolves but has no ready endpoints is left untouched (keeps its 
own 503 handling). The resulting config is byte-identical to the 
already-passing `NonExistent` case, so removing the conformance skip is safe.
   
   ### Verification
   
   - New unit test `TestTranslateHTTPRouteOmittedBackendRefs` (omitted + empty 
backendRefs → fault-injection 500).
   - Removed `HTTPRouteNoBackendRefs` from the conformance skip list.
   - Build / translator unit tests / lint clean.
   
   Based on the Gateway API 1.6.0 branch (`feat/gateway-api-1.6.0`).


-- 
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