lua: allow setting complex values in dynamicMetadata#8306
Merged
dio merged 3 commits intoenvoyproxy:masterfrom Sep 30, 2019
Merged
lua: allow setting complex values in dynamicMetadata#8306dio merged 3 commits intoenvoyproxy:masterfrom
dio merged 3 commits intoenvoyproxy:masterfrom
Conversation
Signed-off-by: Vicent Marti <vmg@strn.cat>
|
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! |
Member
|
@vmg Looks good, can you merge master? |
Signed-off-by: Vicent Marti <vmg@strn.cat>
Signed-off-by: Vicent Marti <vmg@strn.cat>
Author
|
@dio: fixed all your comments and merged master. |
Author
|
🙇 Thank you so much! |
danzh2010
pushed a commit
to danzh2010/envoy
that referenced
this pull request
Oct 4, 2019
Description: This PR fixes a small TODO left by @dio: `Allow to set dynamic metadata using a table.` in the Lua API. Although the `get` function will convert any `Protobuf::Value` into its corresponding Lua type, the reverse `set` function would only allow plain strings to be passed as metadata. The code turns out to be rather straightforward. The most controversial bit is the heuristic to detect whether a Lua table should be converted to a Protobuf `Struct` or `ListValue`. This heuristic is the one that most Lua JSON implementations use to decide whether a table is serialized as a JSON map or array. Risk Level: Low Testing: Unit tests for complex Lua structures & failure cases have been added Docs Changes: The `lua_filter.rst` documentation has been updated to point out that other values besides strings can be passed as metadata. Release Notes: Updated Signed-off-by: Vicent Marti <vmg@strn.cat>
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: This PR fixes a small TODO left by @dio:
Allow to set dynamic metadata using a table.in the Lua API. Although thegetfunction will convert anyProtobuf::Valueinto its corresponding Lua type, the reversesetfunction would only allow plain strings to be passed as metadata.The code turns out to be rather straightforward. The most controversial bit is the heuristic to detect whether a Lua table should be converted to a Protobuf
StructorListValue. This heuristic is the one that most Lua JSON implementations use to decide whether a table is serialized as a JSON map or array.Risk Level: Low
Testing: Unit tests for complex Lua structures & failure cases have been added
Docs Changes: The
lua_filter.rstdocumentation has been updated to point out that other values besides strings can be passed as metadata.Release Notes: Updated
cc @gorzell
Signed-off-by: Vicent Marti vmg@strn.cat