-
Notifications
You must be signed in to change notification settings - Fork 117
feat: add route-level HeaderMutation support for request header manipulation #1414
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
feat: add route-level HeaderMutation support for request header manipulation #1414
Conversation
…ulation Signed-off-by: Sukumar Gaonkar <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project status has failed because the head coverage (78.67%) is below the target coverage (86.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #1414 +/- ##
==========================================
+ Coverage 78.64% 78.67% +0.03%
==========================================
Files 140 140
Lines 13789 13813 +24
==========================================
+ Hits 10844 10868 +24
Misses 2289 2289
Partials 656 656 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…mutation # Conflicts: # manifests/charts/ai-gateway-helm/crds/aigateway.envoyproxy.io_aigatewayroutes.yaml
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.
Overall looks good to me. Deferring to Takeshi as he is assigned to this
| // Merge Set operations (route-level wins conflicts) | ||
| headerMap := make(map[string]gwapiv1.HTTPHeader) | ||
|
|
||
| // Add backend-level headers first |
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.
Curious, why add comments for the Set logic but not the Remove? Also, add periods at the end of the comments.
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.
nit but looks good
Signed-off-by: Dan Sun <[email protected]>
Signed-off-by: Dan Sun <[email protected]>
Description
This commit implements route-level HeaderMutation support for AIGatewayRouteRuleBackendRef. The feature allows users to define header mutations at the route level (per backend reference on AIGatewayRoute) in addition to the existing backend-level HeaderMutation support.
Key Features:
headerMutationfield inAIGatewayRouteRuleBackendReffor fine-grained headercontrol per route
with route-level taking precedence for conflicts
X-Customvsx-customare treated as the same header)
Use Cases:
GCP Provisioned Throughput [docs [1]]:
1: https://cloud.google.com/vertex-ai/generative-ai/docs/provisioned-throughput/use-provisioned-throughput#limitations-of-the-dashboard