Current Behavior
API7 Ingress Controller 2.2.0 and the current master branch do not generate the Gateway API 500 fallback when an HTTPRoute rule omits backendRefs or sets it to an empty list.
The HTTPRoute translator currently adds fault-injection only when backend resolution returns an error. With no backend references to resolve, backendErr remains nil and the rule does not receive the required fallback response.
The HTTPRouteNoBackendRefs Gateway API conformance test is already identified as a known gap in #467, but the behavior does not have a dedicated implementation issue. This is remaining work under the Gateway API 1.6 tracking issue #429.
Apache APISIX Ingress Controller addressed the no-backend case in apache/apisix-ingress-controller#2804. The corresponding Gateway API 1.6 port in #431 did not include that change.
Expected Behavior
An HTTPRoute rule that omits backendRefs, or sets it to an empty list, should explicitly return HTTP 500 when the rule has no filter that produces a response. This should satisfy the Gateway API 1.6 HTTPRouteNoBackendRefs conformance test.
Rules that intentionally produce a response without a backend must continue to work. In particular:
- A
RequestRedirect filter without a backend must keep returning its redirect response.
- API7 response-producing
ExtensionRef plugins must not be overwritten by an unconditional fault-injection fallback.
The upstream implementation recognizes RequestRedirect, but API7 also needs regression coverage for its response-producing ExtensionRef use case before the upstream change is adopted.
Steps to Reproduce
-
Install API7 Ingress Controller 2.2.0 with Gateway API 1.6 CRDs and configure a working Gateway.
-
Apply an HTTPRoute containing rules with omitted and empty backendRefs:
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: no-backendrefs
spec:
parentRefs:
- name: gateway
rules:
- matches:
- path:
type: Exact
value: /omitted
- matches:
- path:
type: Exact
value: /empty
backendRefs: []
-
Request /omitted and /empty through the Gateway.
-
Observe that the rules do not explicitly return the required 500 response.
The upstream Gateway API fixture and assertions are in HTTPRouteNoBackendRefs.
Acceptance Criteria
- Omitted or empty
backendRefs with no response-producing filter returns 500.
RequestRedirect without a backend continues to work.
- A response-producing API7
ExtensionRef plugin without a backend continues to work.
- Translator regression tests cover all three cases.
HTTPRouteNoBackendRefs is removed from the known-gap skip list and passes in the applicable conformance modes.
Environment
- API7 Ingress Controller: 2.2.0 and current
master
- Gateway API: 1.6.0
Related
Current Behavior
API7 Ingress Controller 2.2.0 and the current
masterbranch do not generate the Gateway API500fallback when an HTTPRoute rule omitsbackendRefsor sets it to an empty list.The HTTPRoute translator currently adds
fault-injectiononly when backend resolution returns an error. With no backend references to resolve,backendErrremains nil and the rule does not receive the required fallback response.The
HTTPRouteNoBackendRefsGateway API conformance test is already identified as a known gap in #467, but the behavior does not have a dedicated implementation issue. This is remaining work under the Gateway API 1.6 tracking issue #429.Apache APISIX Ingress Controller addressed the no-backend case in apache/apisix-ingress-controller#2804. The corresponding Gateway API 1.6 port in #431 did not include that change.
Expected Behavior
An HTTPRoute rule that omits
backendRefs, or sets it to an empty list, should explicitly return HTTP500when the rule has no filter that produces a response. This should satisfy the Gateway API 1.6HTTPRouteNoBackendRefsconformance test.Rules that intentionally produce a response without a backend must continue to work. In particular:
RequestRedirectfilter without a backend must keep returning its redirect response.ExtensionRefplugins must not be overwritten by an unconditionalfault-injectionfallback.The upstream implementation recognizes
RequestRedirect, but API7 also needs regression coverage for its response-producingExtensionRefuse case before the upstream change is adopted.Steps to Reproduce
Install API7 Ingress Controller 2.2.0 with Gateway API 1.6 CRDs and configure a working Gateway.
Apply an HTTPRoute containing rules with omitted and empty
backendRefs:Request
/omittedand/emptythrough the Gateway.Observe that the rules do not explicitly return the required
500response.The upstream Gateway API fixture and assertions are in
HTTPRouteNoBackendRefs.Acceptance Criteria
backendRefswith no response-producing filter returns500.RequestRedirectwithout a backend continues to work.ExtensionRefplugin without a backend continues to work.HTTPRouteNoBackendRefsis removed from the known-gap skip list and passes in the applicable conformance modes.Environment
masterRelated