Skip to content

Conversation

@zhaohuabing
Copy link
Member

@zhaohuabing zhaohuabing commented Nov 10, 2025

Fixes #7473
Release Notes: Yes

@zhaohuabing zhaohuabing requested a review from a team as a code owner November 10, 2025 07:56
@zhaohuabing zhaohuabing marked this pull request as draft November 10, 2025 07:56
@zhaohuabing zhaohuabing changed the title fix: mirror filter can't be used with direct response fix: prevent configuring requestMirror filter and directResponse filter together Nov 10, 2025
@codecov
Copy link

codecov bot commented Nov 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.26%. Comparing base (fe44f2c) to head (66471dc).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7474      +/-   ##
==========================================
- Coverage   72.28%   72.26%   -0.02%     
==========================================
  Files         231      231              
  Lines       34084    34088       +4     
==========================================
- Hits        24636    24633       -3     
- Misses       7674     7679       +5     
- Partials     1774     1776       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

cnvergence
cnvergence previously approved these changes Nov 10, 2025
@zhaohuabing zhaohuabing force-pushed the fix-7473 branch 2 times, most recently from 07b6933 to 1983322 Compare November 11, 2025 02:13
@zhaohuabing zhaohuabing changed the title fix: prevent configuring requestMirror filter and directResponse filter together fix: prevent configuring requestMirror filter and directResponse/RequestRedirect filter together Nov 11, 2025
@zhaohuabing zhaohuabing force-pushed the fix-7473 branch 2 times, most recently from 262675f to cd6cef5 Compare November 12, 2025 06:20
@cnvergence
Copy link
Member

/retest

name: gateway-1
sectionName: http
rules:
- matches:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add a mixed rule case, where one rule is valid and one isnt, to make sure the valid rule is not impacted

Copy link
Member Author

@zhaohuabing zhaohuabing Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the Gateway API specific, The HTTPRouteAccepted condition should be set to false with IncompatibleFilters reason when there are incompatible filters present on a route rule.

https://github.com/kubernetes-sigs/gateway-api/blob/f24f3a61f398c65ab629da1843cb65fd5ec9419f/apis/v1/shared_types.go#L384-L387

And EG skips the HTTPRoutes with Accepted status as False, which is reasonable as the entire HTTPRoute has been rejected.

if parentRef.HasCondition(httpRoute, gwapiv1.RouteConditionAccepted, metav1.ConditionFalse) {
continue
}

Copy link
Member Author

@zhaohuabing zhaohuabing Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked the Gateway API spec again, it seems that we should set Accepted as true as long as at least one rule is valid and implemented, even if some other rules in the same HTTPRoute are invalid.

// A Route MUST be considered "Accepted" if at least one of the Route's
// rules is implemented by the Gateway.

Changing this behavior would require a global update and could affect other cases as well. We'd better handle it in a separate PR. If we agree on this, I can raise a PR to address it first.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah can we tackle this as part of #7545 and then start adding more fail fast cases

@zhaohuabing zhaohuabing requested a review from arkodg November 18, 2025 06:39
@zhaohuabing zhaohuabing marked this pull request as draft November 18, 2025 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RequestMirror silently fails when HTTPRoute is configured with a filter with direct response

3 participants