Skip to content

Commit 52793c7

Browse files
authored
refactor: removes deprecated fields in filterapi (#1589)
**Description** `metadataNamespace` and `modelNameHeaderKey` in the filterapi are no longer used since v0.4, so this commit removes them. Signed-off-by: Takeshi Yoneda <[email protected]>
1 parent 64bc182 commit 52793c7

File tree

4 files changed

+0
-15
lines changed

4 files changed

+0
-15
lines changed

cmd/aigw/testdata/translate_basic.out.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,6 @@ stringData:
217217
schema:
218218
name: OpenAI
219219
version: v1
220-
metadataNamespace: io.envoy.ai_gateway
221-
modelNameHeaderKey: x-ai-eg-model
222220
models:
223221
- CreatedAt: "2025-05-23T00:00:00Z"
224222
Name: gpt-4o-mini

internal/controller/gateway.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,6 @@ func (c *GatewayController) reconcileFilterConfigSecret(
297297
) error {
298298
// Precondition: aiGatewayRoutes is not empty as we early return if it is empty.
299299
ec := &filterapi.Config{UUID: uuid}
300-
// TODO: Drop this after v0.4.0.
301-
ec.ModelNameHeaderKey = internalapi.ModelNameHeaderKeyDefault
302-
ec.MetadataNamespace = aigv1a1.AIGatewayFilterMetadataNamespace
303300
var err error
304301
llmCosts := map[string]struct{}{}
305302
for i := range aiGatewayRoutes {

internal/filterapi/filterconfig.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,9 @@ var DefaultConfig = ``
2828
type Config struct {
2929
// UUID is the unique identifier of the filter configuration assigned by the AI Gateway when the configuration is updated.
3030
UUID string `json:"uuid,omitempty"`
31-
// MetadataNamespace is the namespace of the dynamic metadata to be used by the filter.
32-
// Deprecated.
33-
// TODO: Drop this after v0.4.0.
34-
MetadataNamespace string `json:"metadataNamespace"`
3531
// LLMRequestCost configures the cost of each LLM-related request. Optional. If this is provided, the filter will populate
3632
// the "calculated" cost in the filter metadata at the end of the response body processing.
3733
LLMRequestCosts []LLMRequestCost `json:"llmRequestCosts,omitempty"`
38-
// ModelNameHeaderKey is the header key to be populated with the model name by the filter.
39-
// Deprecated.
40-
// TODO: Drop this after v0.4.0.
41-
ModelNameHeaderKey internalapi.ModelNameHeaderKey `json:"modelNameHeaderKey"`
4234
// Backends is the list of backends that this listener can route to.
4335
Backends []Backend `json:"backends,omitempty"`
4436
// Models is the list of models that this route is aware of. Used to populate the "/models" endpoint in OpenAI-compatible APIs.

internal/filterapi/watcher_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ func testStartConfigWatcher(t *testing.T) {
8686
cfg := `
8787
schema:
8888
name: OpenAI
89-
modelNameHeaderKey: x-ai-eg-model
9089
backends:
9190
- name: kserve
9291
weight: 1
@@ -117,7 +116,6 @@ backends:
117116
cfg = `
118117
schema:
119118
name: OpenAI
120-
modelNameHeaderKey: x-ai-eg-model
121119
backends:
122120
- name: openai
123121
schema:

0 commit comments

Comments
 (0)