fix: name AIGatewayRoute HTTPRoute rules#2334
Open
Aias00 wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the controller’s generated HTTPRoute rules for AIGatewayRoute resources to assign deterministic HTTPRouteRule.Name values so Envoy Gateway policies can target specific rules via targetRefs.sectionName (notably for per-route/rule SecurityPolicy use cases).
Changes:
- Assign a stable
Nameto each generated non-defaultHTTPRouteRule(single-rule routes use the route name; multi-rule routes use<route>-rule-<index>). - Keep the existing catch-all default rule name (
route-not-found) while centralizing it as a constant. - Add unit tests covering rule naming behavior, including truncation to stay within Gateway API length limits.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/controller/ai_gateway_route.go | Names generated HTTPRoute rules deterministically and preserves the default route-not-found rule name. |
| internal/controller/ai_gateway_route_test.go | Updates existing expectations and adds targeted tests for the new rule naming helper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Aias00
force-pushed
the
fix/multiple-aigatewayroute-api-keys
branch
from
July 7, 2026 10:09
0339f04 to
421efff
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2334 +/- ##
=======================================
Coverage 84.83% 84.84%
=======================================
Files 148 148
Lines 21877 21888 +11
=======================================
+ Hits 18559 18570 +11
Misses 2197 2197
Partials 1121 1121 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
|
/retest |
Signed-off-by: liuhy <liuhongyu@apache.org>
Aias00
force-pushed
the
fix/multiple-aigatewayroute-api-keys
branch
from
July 10, 2026 15:49
421efff to
7919655
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Name generated HTTPRoute rules for AIGatewayRoute resources so Envoy Gateway policies can target a specific rule with targetRefs.sectionName. Single-rule routes use the AIGatewayRoute name as the section name, while multi-rule routes use a stable -rule- name and preserve the existing route-not-found catch-all rule name.
Related Issues/PRs (if applicable)
Fixes #1474.
Special notes for reviewers (if applicable)
Validation:
go test ./...was started but interrupted after several minutes while waiting on the crdcel package to run Helm CRD retrieval; no test failure output was produced before interruption.