-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lua: add new methods to access network connection streamInfo() & dynamicMetadata() #22246
Conversation
8937634
to
5c71b9c
Compare
cc @ggreenway |
/retest |
Retrying Azure Pipelines: |
…icMetadata() Signed-off-by: Rohit Agrawal <[email protected]>
5c71b9c
to
af7181b
Compare
This pull request has been automatically marked as stale because it has not had activity in the last 30 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! |
My team is interested in seeing this PR get through. We too need to get proxy protocol dynamic metadata at the HCM to forward to upstream. Is there an alternative? |
/assign |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for working on this. it make sense to me.
lua_state_.registerType<ConnectionStreamInfoWrapper>(); | ||
lua_state_.registerType<ConnectionDynamicMetadataMapWrapper>(); | ||
lua_state_.registerType<ConnectionDynamicMetadataMapIterator>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should the stream info and dynamic metadata need independent type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good question. I wasn't aware of any implications for re-using the one we have for HTTP-level stream info object so I created separate ones for the listener-level stream info. If you think it's fine to reuse the existing ones then we can remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good question. I wasn't aware of any implications for re-using the one we have for HTTP-level stream info object so I created separate ones for the listener-level stream info. If you think it's fine to reuse the existing ones then we can remove it.
Yeah, I think it would be better to just reuse this wrapper.
@wbpcode friendly ping on review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's LGTM overall, except I think it would be better to reuse the exist type wrapper. Thanks.
And sorry for the delayed review.
/wait-any
lua_state_.registerType<ConnectionStreamInfoWrapper>(); | ||
lua_state_.registerType<ConnectionDynamicMetadataMapWrapper>(); | ||
lua_state_.registerType<ConnectionDynamicMetadataMapIterator>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good question. I wasn't aware of any implications for re-using the one we have for HTTP-level stream info object so I created separate ones for the listener-level stream info. If you think it's fine to reuse the existing ones then we can remove it.
Yeah, I think it would be better to just reuse this wrapper.
This pull request has been automatically marked as stale because it has not had activity in the last 30 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 37 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! |
@agrawroh what's the next step to enable access to metadata? |
Background
Currently, there seems to be no way to access the dynamic metadata set by any network filters in LUA or any other HTTP filters.
streamInfo()
is accessible on the connection and could be used to fetch thedynamicMetadata()
from the network filters but it's is currently not exposed in HTTP LUA filter.Use Case
We want to read the TLV values set by the
proxy_protocol
filter in the dynamic metadata in the LUA filter so that we can propagate these TLV pairs to the upstream services for some further processing.Changes
This PR adds a new
connectionStreamInfo()
methods to LUA filter that could be used to access the Stream Info object on the connection and then fetch the dynamic metadata from network filters like this:Commit Message: add new methods to access network connection streamInfo() & dynamicMetadata().
Additional Description: See Background Section.
Risk Level: Low
Testing: Unit Tests
Docs Changes: Added the description of the new methods added in LUA.
Release Notes: Added
Platform Specific Features: N/A
Signed-off-by: Rohit Agrawal [email protected]