Repository navigation
fix envoy.filters.http.lua metadata empty - #17359
Conversation
Signed-off-by: chris.xin <[email protected]>
d9a64fc to
93b6ef9
Compare
|
i will add unit test later |
|
Can you elaborate on the issue a bit more? If the problem is just around the metadata entry not being set can we just gate on what instead of having to rely on dynamic casts? |
|
yeah, i think so, i will add |
Signed-off-by: chris.xin <[email protected]>
8b1296c to
9be2873
Compare
|
Looks like CI is broken, and this will need a test case as well /wait |
Signed-off-by: chris.xin <[email protected]>
Signed-off-by: chris.xin <[email protected]>
23745c6 to
6aacda9
Compare
| * @return const envoy::config::core::v3::Metadata& return the metadata provided in the config for | ||
| * this route. | ||
| */ | ||
| virtual const envoy::config::core::v3::Metadata& metadata() const { return empty_metadata_; } |
There was a problem hiding this comment.
Do you know why we don't just return a RouteEntry for direct response entries? I'm a bit concerned that exposing metadata on both Route and RouteEntry leaves the API in an odd state where it's not clear why one would use on over the other. Thoughts?
There was a problem hiding this comment.
yeah, it will be odd state. but how can it get the metadatas int http filter for direct response entries?
There was a problem hiding this comment.
I think it probably would be populated on the RouteEntryImplBase already, we just somehow refuse to give the caller a RouteEntry when it's a direct response. @mattklein123 @alyssawilk any idea why we special case direct response in this way?
The current proposed implementation seems incomplete as well, seems like we'd always return empty metadata in this case?
There was a problem hiding this comment.
yeah seems weird to me, I'd rather (runtime guard) expose the route entry on direct response but maybe git blame who special cased it and ask them?
There was a problem hiding this comment.
From looking at the code, I suspect the original intention is that a direction response != an upstream route entry, and that is why the interface/code is broken down that way. I have 2 comments:
- Personally, I would remove metadata() from RouteEntry and add it to Route as this PR does. Then it can be grabbed in all cases.
- I don't understand how always returning empty metadata here makes sense. Don't you want to return the configured route metadata?
There was a problem hiding this comment.
i try to remove metadata() from Router::RouteEntry, so many files will be change. i think it will take another problems.
There was a problem hiding this comment.
Yes, it will be a larger change, but that is the change we need to do.
There was a problem hiding this comment.
ok, i will do it
There was a problem hiding this comment.
I'm still not sure why this is returning empty metadata. I would keep this as a PURE virtual function and let the implementation return the right thing.
/wait
Signed-off-by: chris.xin <[email protected]>
Signed-off-by: chris.xin <[email protected]>
Signed-off-by: Chris Xin <[email protected]>
aa5fcd0 to
6f0ce39
Compare
c45afb5 to
e5a8fba
Compare
Signed-off-by: chris.xin <[email protected]>
51a67ac to
7dbfacf
Compare
Signed-off-by: chris.xin <[email protected]>
mattklein123
left a comment
There was a problem hiding this comment.
Thanks this looks like great progress.
/wait
| const envoy::config::core::v3::Metadata metadata_; | ||
| const Envoy::Config::TypedMetadataImpl<Envoy::Config::TypedMetadataFactory> typed_metadata_; |
There was a problem hiding this comment.
This should be calling the parent methods, not returning empty.
There was a problem hiding this comment.
I accidentally ignored it.
Signed-off-by: Chris Xin <[email protected]>
4bb0d58 to
9a6096f
Compare
Signed-off-by: Chris Xin <[email protected]>
Signed-off-by: Chris Xin <[email protected]>
|
@chrisxrepo please do not force push as it makes reviews much more difficult. Just merge main and add commits. Thanks! |
mattklein123
left a comment
There was a problem hiding this comment.
Thanks this is a great change. A small comment. Thank you!
/wait
| #include "source/common/config/datasource.h" | ||
| #include "source/common/crypto/utility.h" | ||
| #include "source/common/http/message_impl.h" | ||
| #include "source/common/router/config_impl.h" |
There was a problem hiding this comment.
No need to include the impl here or in the BUILD file above, same elsewhere if I missed it.
Signed-off-by: Chris Xin <[email protected]>
|
/retest |
|
Retrying Azure Pipelines: |
mattklein123
left a comment
There was a problem hiding this comment.
Thanks LGTM with another small change. @snowp any further comments?
/wait
| "//source/common/config:datasource_lib", | ||
| "//source/common/crypto:utility_lib", | ||
| "//source/common/http:message_lib", | ||
| "//source/common/router:config_lib", |
snowp
left a comment
There was a problem hiding this comment.
LGTM, just one small comment
|
|
||
| namespace Router { | ||
| class Route; | ||
| class RouteEntry; |
There was a problem hiding this comment.
Do we still need this forward declaration?
Signed-off-by: Chris Xin <[email protected]>
Signed-off-by: Chris Xin <[email protected]>
Signed-off-by: Chris Xin [email protected]
if route set direct response,
callbacks->route()->routeEntry()will return nullptr. request_handle:metadata() will return empty in filter:filter.http.luainline lua script,Commit Message:
Additional Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #17166]
[Optional Deprecated:]
[Optional API Considerations:]