feat(api): Add filterContext field to Lua type in EnvoyExtensionPolicy - #8730
Conversation
✅ Deploy Preview for cerulean-figolla-1f9435 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
694e6c9 to
846777f
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8730 +/- ##
==========================================
+ Coverage 75.19% 75.20% +0.01%
==========================================
Files 252 252
Lines 41031 41037 +6
==========================================
+ Hits 30853 30862 +9
+ Misses 8083 8080 -3
Partials 2095 2095 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
4bc5e02 to
070ba24
Compare
|
|
rudrakhp
left a comment
There was a problem hiding this comment.
You will need to add mocks for the filterContext() api in the validator mocks which is failing your E2E. Please refer how other APIs are mocked for this.
81ff141 to
c6098cd
Compare
f8106cf to
6dc32d9
Compare
rudrakhp
left a comment
There was a problem hiding this comment.
Overall LGTM with some comments. Thanks for the contribution!
…#8715) Add an optional `filterContext` field (map[string]string) to the Lua type in EnvoyExtensionPolicySpec. This exposes Envoy's existing LuaPerRoute.filter_context so that a shared Lua script can be parameterized differently per route via request_handle:filterContext(). Without this, users must either duplicate the entire script inline with hardcoded values or resort to EnvoyPatchPolicy to manually patch xDS. Changes: - api: add FilterContext to Lua struct - ir: add FilterContext to IR Lua struct - gatewayapi: pass FilterContext from API to IR in buildLua() - xds: set FilterContext on LuaPerRoute in patchRoute(), converting map[string]string to structpb.Struct - tests: update gatewayapi/xds translator testdata, add e2e test - docs: add FilterContext section to Lua extension task guide Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com>
Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com>
Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com>
Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com>
Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com>
Address review feedback on envoyproxy#8730: - Change FilterContext field type from map[string]string to *apiextensionsv1.JSON in both the API (lua_types.go) and IR (xds.go), matching the existing pattern used by Wasm.Config and DynamicModule.Config. - Drop json/yaml struct tags from ir.Lua.FilterContext, consistent with the other untagged fields on that struct. - Update the xDS translator to unmarshal FilterContext.Raw into structpb.Struct via protojson.Unmarshal, replacing the previous string-only map iteration. - Regenerate deepcopy, CRD manifests, and test fixtures. Users can now pass non-string JSON values (numbers, bools, nested objects) in filterContext without stringifying them. Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com>
6dc32d9 to
93ac819
Compare
Address review feedback on envoyproxy#8730: - Change FilterContext field type from map[string]string to *apiextensionsv1.JSON in both the API (lua_types.go) and IR (xds.go), matching the existing pattern used by Wasm.Config and DynamicModule.Config. - Drop json/yaml struct tags from ir.Lua.FilterContext, consistent with the other untagged fields on that struct. - Update the xDS translator to unmarshal FilterContext.Raw into structpb.Struct via protojson.Unmarshal, replacing the previous string-only map iteration. - Regenerate deepcopy, CRD manifests, and test fixtures. Users can now pass non-string JSON values (numbers, bools, nested objects) in filterContext without stringifying them. Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com>
93ac819 to
c01f433
Compare
…ropagate filter context in Lua test filterContext() is only available on request_handle, not response_handle. Read the value in envoy_on_request and store it via dynamicMetadata, then retrieve it in envoy_on_response to set the X-Lua-Filter-Context header. Fixes TestE2E/LuaHTTP/http_route_with_lua_filter_context Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com>
|
@norman-zon the |
…ilterContext() directly The previous script had a nil-value bug: - ctx["custom_value"] returns nil when filterContext() wraps an empty struct - Storing nil via dynamicMetadata and then using it in headers():add() caused a silent Lua error, so the response header was never set Fix by calling response_handle:filterContext() directly in envoy_on_response, which is available on both request and response handles per Envoy's C++ source. Also add a nil guard for val before calling headers():add() to be safe. Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com>
4c7ed0c to
6f8bc94
Compare
…policy-filtercontext
|
@rudrakhp, I think I found the issue. Can you please re-trigger the tests? |
|
/retest |
|
I think I need a bit of help with fixing the E2E tests. Could someone take a look and give me a hint? |
…ases Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com>
Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com>
filterContext() returns a MetadataMapWrapper whose only Lua methods are
get and __pairs; its metatable __index points at the methods table, so
ctx["custom_value"] resolves to a method lookup and always returns nil.
Read values via ctx:get("custom_value") instead.
The per-route filter config is re-resolved on the response path, so the
response handle exposes filterContext directly; the dynamicMetadata bridge
is unnecessary and the script is now a single response-phase function.
Update the luavalidator mock so StreamHandle:filterContext() returns the
Metadata wrapper (with a :get method) matching real Envoy, add a validator
test for the get() syntax, and fix the docs examples accordingly.
Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com>
7847562 to
0351375
Compare
|
Ok. One more try. Can you please /retest @zirain |
|
/retest |
Signed-off-by: Rudrakh Panigrahi <rudrakh97@gmail.com>
envoyproxy#8730) * feat: add filterContext field to Lua EnvoyExtensionPolicy (envoyproxy#8715) Add an optional `filterContext` field (map[string]string) to the Lua type in EnvoyExtensionPolicySpec. This exposes Envoy's existing LuaPerRoute.filter_context so that a shared Lua script can be parameterized differently per route via request_handle:filterContext(). Without this, users must either duplicate the entire script inline with hardcoded values or resort to EnvoyPatchPolicy to manually patch xDS. Changes: - api: add FilterContext to Lua struct - ir: add FilterContext to IR Lua struct - gatewayapi: pass FilterContext from API to IR in buildLua() - xds: set FilterContext on LuaPerRoute in patchRoute(), converting map[string]string to structpb.Struct - tests: update gatewayapi/xds translator testdata, add e2e test - docs: add FilterContext section to Lua extension task guide Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * feat: update release notes Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * chore: regenerate test output and helm CRD files Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix: add missing mocks Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix(e2e): use retry pattern for lua filter context test Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix(api): use apiextensionsv1.JSON for Lua filterContext Address review feedback on envoyproxy#8730: - Change FilterContext field type from map[string]string to *apiextensionsv1.JSON in both the API (lua_types.go) and IR (xds.go), matching the existing pattern used by Wasm.Config and DynamicModule.Config. - Drop json/yaml struct tags from ir.Lua.FilterContext, consistent with the other untagged fields on that struct. - Update the xDS translator to unmarshal FilterContext.Raw into structpb.Struct via protojson.Unmarshal, replacing the previous string-only map iteration. - Regenerate deepcopy, CRD manifests, and test fixtures. Users can now pass non-string JSON values (numbers, bools, nested objects) in filterContext without stringifying them. Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix(e2e): use request_handle:filterContext() and dynamicMetadata to propagate filter context in Lua test filterContext() is only available on request_handle, not response_handle. Read the value in envoy_on_request and store it via dynamicMetadata, then retrieve it in envoy_on_response to set the X-Lua-Filter-Context header. Fixes TestE2E/LuaHTTP/http_route_with_lua_filter_context Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix(e2e): simplify lua filter context script to use response_handle:filterContext() directly The previous script had a nil-value bug: - ctx["custom_value"] returns nil when filterContext() wraps an empty struct - Storing nil via dynamicMetadata and then using it in headers():add() caused a silent Lua error, so the response header was never set Fix by calling response_handle:filterContext() directly in envoy_on_response, which is available on both request and response handles per Envoy's C++ source. Also add a nil guard for val before calling headers():add() to be safe. Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix(e2e): use dynamicMetadata to bridge lua filter context between phases Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix(e2e): simplify lua filter context by storing value string directly Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix(e2e): read Lua filterContext via ctx:get() instead of table indexing filterContext() returns a MetadataMapWrapper whose only Lua methods are get and __pairs; its metatable __index points at the methods table, so ctx["custom_value"] resolves to a method lookup and always returns nil. Read values via ctx:get("custom_value") instead. The per-route filter config is re-resolved on the response path, so the response handle exposes filterContext directly; the dynamicMetadata bridge is unnecessary and the script is now a single response-phase function. Update the luavalidator mock so StreamHandle:filterContext() returns the Metadata wrapper (with a :get method) matching real Envoy, add a validator test for the get() syntax, and fix the docs examples accordingly. Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> --------- Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> Signed-off-by: Rudrakh Panigrahi <rudrakh97@gmail.com> Co-authored-by: Rudrakh Panigrahi <rudrakh97@gmail.com>
envoyproxy#8730) * feat: add filterContext field to Lua EnvoyExtensionPolicy (envoyproxy#8715) Add an optional `filterContext` field (map[string]string) to the Lua type in EnvoyExtensionPolicySpec. This exposes Envoy's existing LuaPerRoute.filter_context so that a shared Lua script can be parameterized differently per route via request_handle:filterContext(). Without this, users must either duplicate the entire script inline with hardcoded values or resort to EnvoyPatchPolicy to manually patch xDS. Changes: - api: add FilterContext to Lua struct - ir: add FilterContext to IR Lua struct - gatewayapi: pass FilterContext from API to IR in buildLua() - xds: set FilterContext on LuaPerRoute in patchRoute(), converting map[string]string to structpb.Struct - tests: update gatewayapi/xds translator testdata, add e2e test - docs: add FilterContext section to Lua extension task guide Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * feat: update release notes Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * chore: regenerate test output and helm CRD files Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix: add missing mocks Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix(e2e): use retry pattern for lua filter context test Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix(api): use apiextensionsv1.JSON for Lua filterContext Address review feedback on envoyproxy#8730: - Change FilterContext field type from map[string]string to *apiextensionsv1.JSON in both the API (lua_types.go) and IR (xds.go), matching the existing pattern used by Wasm.Config and DynamicModule.Config. - Drop json/yaml struct tags from ir.Lua.FilterContext, consistent with the other untagged fields on that struct. - Update the xDS translator to unmarshal FilterContext.Raw into structpb.Struct via protojson.Unmarshal, replacing the previous string-only map iteration. - Regenerate deepcopy, CRD manifests, and test fixtures. Users can now pass non-string JSON values (numbers, bools, nested objects) in filterContext without stringifying them. Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix(e2e): use request_handle:filterContext() and dynamicMetadata to propagate filter context in Lua test filterContext() is only available on request_handle, not response_handle. Read the value in envoy_on_request and store it via dynamicMetadata, then retrieve it in envoy_on_response to set the X-Lua-Filter-Context header. Fixes TestE2E/LuaHTTP/http_route_with_lua_filter_context Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix(e2e): simplify lua filter context script to use response_handle:filterContext() directly The previous script had a nil-value bug: - ctx["custom_value"] returns nil when filterContext() wraps an empty struct - Storing nil via dynamicMetadata and then using it in headers():add() caused a silent Lua error, so the response header was never set Fix by calling response_handle:filterContext() directly in envoy_on_response, which is available on both request and response handles per Envoy's C++ source. Also add a nil guard for val before calling headers():add() to be safe. Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix(e2e): use dynamicMetadata to bridge lua filter context between phases Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix(e2e): simplify lua filter context by storing value string directly Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix(e2e): read Lua filterContext via ctx:get() instead of table indexing filterContext() returns a MetadataMapWrapper whose only Lua methods are get and __pairs; its metatable __index points at the methods table, so ctx["custom_value"] resolves to a method lookup and always returns nil. Read values via ctx:get("custom_value") instead. The per-route filter config is re-resolved on the response path, so the response handle exposes filterContext directly; the dynamicMetadata bridge is unnecessary and the script is now a single response-phase function. Update the luavalidator mock so StreamHandle:filterContext() returns the Metadata wrapper (with a :get method) matching real Envoy, add a validator test for the get() syntax, and fix the docs examples accordingly. Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> --------- Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> Signed-off-by: Rudrakh Panigrahi <rudrakh97@gmail.com> Co-authored-by: Rudrakh Panigrahi <rudrakh97@gmail.com>
envoyproxy#8730) * feat: add filterContext field to Lua EnvoyExtensionPolicy (envoyproxy#8715) Add an optional `filterContext` field (map[string]string) to the Lua type in EnvoyExtensionPolicySpec. This exposes Envoy's existing LuaPerRoute.filter_context so that a shared Lua script can be parameterized differently per route via request_handle:filterContext(). Without this, users must either duplicate the entire script inline with hardcoded values or resort to EnvoyPatchPolicy to manually patch xDS. Changes: - api: add FilterContext to Lua struct - ir: add FilterContext to IR Lua struct - gatewayapi: pass FilterContext from API to IR in buildLua() - xds: set FilterContext on LuaPerRoute in patchRoute(), converting map[string]string to structpb.Struct - tests: update gatewayapi/xds translator testdata, add e2e test - docs: add FilterContext section to Lua extension task guide Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * feat: update release notes Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * chore: regenerate test output and helm CRD files Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix: add missing mocks Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix(e2e): use retry pattern for lua filter context test Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix(api): use apiextensionsv1.JSON for Lua filterContext Address review feedback on envoyproxy#8730: - Change FilterContext field type from map[string]string to *apiextensionsv1.JSON in both the API (lua_types.go) and IR (xds.go), matching the existing pattern used by Wasm.Config and DynamicModule.Config. - Drop json/yaml struct tags from ir.Lua.FilterContext, consistent with the other untagged fields on that struct. - Update the xDS translator to unmarshal FilterContext.Raw into structpb.Struct via protojson.Unmarshal, replacing the previous string-only map iteration. - Regenerate deepcopy, CRD manifests, and test fixtures. Users can now pass non-string JSON values (numbers, bools, nested objects) in filterContext without stringifying them. Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix(e2e): use request_handle:filterContext() and dynamicMetadata to propagate filter context in Lua test filterContext() is only available on request_handle, not response_handle. Read the value in envoy_on_request and store it via dynamicMetadata, then retrieve it in envoy_on_response to set the X-Lua-Filter-Context header. Fixes TestE2E/LuaHTTP/http_route_with_lua_filter_context Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix(e2e): simplify lua filter context script to use response_handle:filterContext() directly The previous script had a nil-value bug: - ctx["custom_value"] returns nil when filterContext() wraps an empty struct - Storing nil via dynamicMetadata and then using it in headers():add() caused a silent Lua error, so the response header was never set Fix by calling response_handle:filterContext() directly in envoy_on_response, which is available on both request and response handles per Envoy's C++ source. Also add a nil guard for val before calling headers():add() to be safe. Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix(e2e): use dynamicMetadata to bridge lua filter context between phases Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix(e2e): simplify lua filter context by storing value string directly Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix(e2e): read Lua filterContext via ctx:get() instead of table indexing filterContext() returns a MetadataMapWrapper whose only Lua methods are get and __pairs; its metatable __index points at the methods table, so ctx["custom_value"] resolves to a method lookup and always returns nil. Read values via ctx:get("custom_value") instead. The per-route filter config is re-resolved on the response path, so the response handle exposes filterContext directly; the dynamicMetadata bridge is unnecessary and the script is now a single response-phase function. Update the luavalidator mock so StreamHandle:filterContext() returns the Metadata wrapper (with a :get method) matching real Envoy, add a validator test for the get() syntax, and fix the docs examples accordingly. Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> --------- Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> Signed-off-by: Rudrakh Panigrahi <rudrakh97@gmail.com> Co-authored-by: Rudrakh Panigrahi <rudrakh97@gmail.com>
envoyproxy#8730) * feat: add filterContext field to Lua EnvoyExtensionPolicy (envoyproxy#8715) Add an optional `filterContext` field (map[string]string) to the Lua type in EnvoyExtensionPolicySpec. This exposes Envoy's existing LuaPerRoute.filter_context so that a shared Lua script can be parameterized differently per route via request_handle:filterContext(). Without this, users must either duplicate the entire script inline with hardcoded values or resort to EnvoyPatchPolicy to manually patch xDS. Changes: - api: add FilterContext to Lua struct - ir: add FilterContext to IR Lua struct - gatewayapi: pass FilterContext from API to IR in buildLua() - xds: set FilterContext on LuaPerRoute in patchRoute(), converting map[string]string to structpb.Struct - tests: update gatewayapi/xds translator testdata, add e2e test - docs: add FilterContext section to Lua extension task guide Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * feat: update release notes Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * chore: regenerate test output and helm CRD files Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix: add missing mocks Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix(e2e): use retry pattern for lua filter context test Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix(api): use apiextensionsv1.JSON for Lua filterContext Address review feedback on envoyproxy#8730: - Change FilterContext field type from map[string]string to *apiextensionsv1.JSON in both the API (lua_types.go) and IR (xds.go), matching the existing pattern used by Wasm.Config and DynamicModule.Config. - Drop json/yaml struct tags from ir.Lua.FilterContext, consistent with the other untagged fields on that struct. - Update the xDS translator to unmarshal FilterContext.Raw into structpb.Struct via protojson.Unmarshal, replacing the previous string-only map iteration. - Regenerate deepcopy, CRD manifests, and test fixtures. Users can now pass non-string JSON values (numbers, bools, nested objects) in filterContext without stringifying them. Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix(e2e): use request_handle:filterContext() and dynamicMetadata to propagate filter context in Lua test filterContext() is only available on request_handle, not response_handle. Read the value in envoy_on_request and store it via dynamicMetadata, then retrieve it in envoy_on_response to set the X-Lua-Filter-Context header. Fixes TestE2E/LuaHTTP/http_route_with_lua_filter_context Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix(e2e): simplify lua filter context script to use response_handle:filterContext() directly The previous script had a nil-value bug: - ctx["custom_value"] returns nil when filterContext() wraps an empty struct - Storing nil via dynamicMetadata and then using it in headers():add() caused a silent Lua error, so the response header was never set Fix by calling response_handle:filterContext() directly in envoy_on_response, which is available on both request and response handles per Envoy's C++ source. Also add a nil guard for val before calling headers():add() to be safe. Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix(e2e): use dynamicMetadata to bridge lua filter context between phases Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix(e2e): simplify lua filter context by storing value string directly Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> * fix(e2e): read Lua filterContext via ctx:get() instead of table indexing filterContext() returns a MetadataMapWrapper whose only Lua methods are get and __pairs; its metatable __index points at the methods table, so ctx["custom_value"] resolves to a method lookup and always returns nil. Read values via ctx:get("custom_value") instead. The per-route filter config is re-resolved on the response path, so the response handle exposes filterContext directly; the dynamicMetadata bridge is unnecessary and the script is now a single response-phase function. Update the luavalidator mock so StreamHandle:filterContext() returns the Metadata wrapper (with a :get method) matching real Envoy, add a validator test for the get() syntax, and fix the docs examples accordingly. Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> --------- Signed-off-by: Norman Stetter <85173861+norman-zon@users.noreply.github.com> Signed-off-by: Rudrakh Panigrahi <rudrakh97@gmail.com> Co-authored-by: Rudrakh Panigrahi <rudrakh97@gmail.com> Signed-off-by: Andrea Abellonio <andrea.abellonio@servescale.ai>
What type of PR is this?
feat/api
What this PR does / why we need it:
Adds an optional
filterContextfield (map[string]string) to theLuatype inEnvoyExtensionPolicySpec, exposing Envoy's existingLuaPerRoute.filter_contextfield.This allows a shared Lua script (stored in a ConfigMap via
ValueRef) to be parameterized differently per route usingrequest_handle:filterContext(). Without this, users must either duplicate the entire script inline with hardcoded values for each route or useEnvoyPatchPolicyto manually patch the generated xDS — both of which are fragile and defeat the purpose of script reuse.Example usage:
The Lua script accesses the values via:
Changes:
api/v1alpha1/lua_types.go— addFilterContext map[string]stringtoLuastructinternal/ir/xds.go— addFilterContextto IRLuastructinternal/gatewayapi/envoyextensionpolicy.go— passFilterContextfrom API → IRinternal/xds/translator/lua.go— setFilterContextonLuaPerRoute, convertingmap[string]string→structpb.StructfilterContext()and sets value as response headerNo new Envoy features required — this only exposes an existing
LuaPerRoutefield.Which issue(s) this PR fixes:
Fixes #8715
Release Notes: Yes