-
Notifications
You must be signed in to change notification settings - Fork 113
Add support for RequestMirror filter #3306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3306 +/- ##
==========================================
+ Coverage 86.16% 86.25% +0.09%
==========================================
Files 113 116 +3
Lines 11664 11923 +259
Branches 62 62
==========================================
+ Hits 10050 10284 +234
- Misses 1553 1576 +23
- Partials 61 63 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Problem: As a user, I want to be able to mirror requests to another backend(s) using the RequestMirror filter on an HTTPRoute or GRPCRoute. Solution: Add support for the RequestMirror filter, allowing users to mirror requests with HTTPRoutes or GRPCRoutes.
63572c7
to
c4c62ce
Compare
RequestMirror: &gatewayv1.HTTPRequestMirrorFilter{}, | ||
}, | ||
expectErrCount: 0, | ||
name: "valid GRPC filter", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name: "valid GRPC filter", | |
name: "valid GRPC mirror filter", |
Should this have mirror in it?
// RouteName builds the name for the internal mirror route, using the user route name, | ||
// service namespace/name, and index of the rule. | ||
// The prefix is used to prevent a user from creating a route with a conflicting name. | ||
func RouteName(routeName, service string, namespace *string, idx int) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the edge case where the namespace is not defined, but the service name ends with "-(insert namespace of another route)", does that matter?
And I guess this works in any case where resource generate identical names when they're not meant to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah good catch. This is where naming these things gets tough. I'll have to figure out how to structure this to avoid those edge cases...
Problem: As a user, I want to be able to mirror requests to another backend(s) using the RequestMirror filter on an HTTPRoute or GRPCRoute.
Solution: Add support for the RequestMirror filter, allowing users to mirror requests with HTTPRoutes or GRPCRoutes.
Testing: Manually verified single mirror filter, multiple mirror filter, mirror filter with other filters.
Note: the RequestMirror conformance tests seem to have a bug in 1.2.1 Gateway API, which may be fixed in 1.3. We can hopefully enable them at that point.
Closes #533
Checklist
Before creating a PR, run through this checklist and mark each as complete.
Release notes
If this PR introduces a change that affects users and needs to be mentioned in the release notes,
please add a brief note that summarizes the change.