-
Notifications
You must be signed in to change notification settings - Fork 200
create default filters per AIGatewayRoute with ownerReference to it #873
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is needed
Milestone
Description
Description:
Currently, AIGateayRoute will be translated with two static HTTPRouteFilters as you can see here
ai-gateway/internal/controller/ai_gateway_route.go
Lines 98 to 120 in f037bd2
| func defaultHTTPRouteFilters(ns string) []*egv1a1.HTTPRouteFilter { | |
| return []*egv1a1.HTTPRouteFilter{ | |
| { | |
| ObjectMeta: metav1.ObjectMeta{Name: hostRewriteHTTPFilterName, Namespace: ns}, | |
| Spec: egv1a1.HTTPRouteFilterSpec{ | |
| URLRewrite: &egv1a1.HTTPURLRewriteFilter{ | |
| Hostname: &egv1a1.HTTPHostnameModifier{ | |
| Type: egv1a1.BackendHTTPHostnameModifier, | |
| }, | |
| }, | |
| }, | |
| }, | |
| { | |
| ObjectMeta: metav1.ObjectMeta{Name: routeNotFoundResponseHTTPFilterName, Namespace: ns}, | |
| Spec: egv1a1.HTTPRouteFilterSpec{ | |
| DirectResponse: &egv1a1.HTTPDirectResponseFilter{ | |
| StatusCode: ptr.To(404), | |
| Body: &egv1a1.CustomResponseBody{ | |
| Inline: ptr.To( | |
| // "Likely" since the matching rule can be arbitrary, not necessarily matching on the model name. | |
| `No matching route found. It is likely that the model specified your request is not configured in the Gateway.`, | |
| ), | |
| }, |
However, they are statically generated, not per AIGatewayRoute, so there is no garbage collecting mechanism to it. For example, deleting AIGatewayRoute, etc won't clean them up.
We can create these two resources per AIGatewayRoute, and add the ownerreference to them to make sure that these two filter resources will be cleaned up. The required change should look similar to the one you see in the issue description of #872
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is needed