lua: Add per filter config for Lua filter#11235
lua: Add per filter config for Lua filter#11235mattklein123 merged 20 commits intoenvoyproxy:masterfrom
Conversation
There was a problem hiding this comment.
Should name and code be in a oneof?
There was a problem hiding this comment.
The name is used to refer to a Lua script in the global configuration, and the code is used to configure a Lua script directly in the Route. They should not be configured repeatedly.
There was a problem hiding this comment.
I kinda agree with @htuch, what is the expected behavior when we set both?
There was a problem hiding this comment.
We cannot set the name and code at the same time. If you need to use the same script in different routes, you can send the script through LDS, and then set the name field in the route configuration. When the script is large, a part of redundant configuration can be reduced. The code is for better flexibility, to avoid all scripts must be issued using LDS.
There was a problem hiding this comment.
OK, it seems like it is. One of disabled, name, or code.
There was a problem hiding this comment.
Looks good, but nit, rename s/code/source_code/ for consistency with source_codes.
4a85e30 to
480f466
Compare
|
This PR is based on @dio 's work. |
|
@wbpcode please do not force-push in Envoy PRs. It makes reviewing your PR impossible. Also, can you fix format errors? That will unblock the rest of CI. Thank you! |
Signed-off-by: wbpcode <comems@msn.com>
Okay. |
Signed-off-by: wbpcode <comems@msn.com>
|
This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
This pull request has been automatically closed because it has not had activity in the last 14 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
|
Any luck of this one getting reviewed and merged in? |
dio
left a comment
There was a problem hiding this comment.
Thanks for picking this up. Sorry for the super late response. Seems like this one is fell off my radar. Sorry.
Functionally it looks good. However, we need to add docs as well regarding this newly introduced features.
There was a problem hiding this comment.
I kinda agree with @htuch, what is the expected behavior when we set both?
|
@wbpcode I also appreciate it if you could elaborate on the changes introduced in this PR into a proper commit message. Thanks! |
|
Thanks for your detailed review and I will try to update this PR ASAP. @dio |
I will. |
|
I think you should do "merge master" as well. Thank you! |
Signed-off-by: wbpcode <comems@msn.com>
Signed-off-by: wbpcode <comems@msn.com>
Signed-off-by: wbpcode <comems@msn.com>
|
A new commit that reduced redundant code and updated integration test. |
|
/retest |
|
🐴 hold your horses - no failures detected, yet. |
|
Please check CI and merge master. /wait |
|
|
||
| // A name of a Lua source code stored in | ||
| // :ref:`Lua.source_codes <envoy_v3_api_field_extensions.filters.http.lua.v3.Lua.source_codes>`. | ||
| string name = 2 [(validate.rules).string.min_len = 1]; |
There was a problem hiding this comment.
string name = 2 [(validate.rules).string = {min_len: 1}];Signed-off-by: wbpcode <comems@msn.com>
|
/retest |
|
🐴 hold your horses - no failures detected, yet. |
|
hmmm, look some wrong with this windows ci. |
Commit Message: Add per filter config support for Lua filter.
This allows Lua filter to support per-route configuration. This patch enables the configured Lua filter to have multiple registered codes that can be referenced from each per-route config. Disabling running the global Lua filter for a route is also supported.
Risk Level: Low
Testing: Added.
Docs Changes: Added.
Release Notes: Added.
Fixes: #9279 #3124