Conversation
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
TODO: http request verifier, host data Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
snowp
left a comment
There was a problem hiding this comment.
Thanks for the test, I left a few comments to get this started
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
The root cause: envoy_build_fixer.py likes either envoy_package or envoy_extension_package(sole in source/extensions). Now that the newly add extension is only used by integration test, I choose to declare in in |
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
|
Seems like CI is broken, can you fix and then I'll take a look? /wait |
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
|
@snowp Thank you for the reminder |
snowp
left a comment
There was a problem hiding this comment.
Thanks this looks better, just a few comments.
Would appreciate @alyssawilk's thoughts as well, in particular on the general usefulness of this test: part of me feels like this is pretty guaranteed to continue to work no matter what happens in the router and elsewhere.
| Envoy::Http::HeaderMapImpl::copyFrom(*dup, headers); | ||
| dup->setCopy(Envoy::Http::LowerCaseString("X-foo"), "foo-common"); | ||
| addHeader(*dup, "X-cluster-foo", host_->cluster().metadata(), "foo", "bar"); | ||
| if (host_->metadata() != nullptr) { | ||
| addHeader(*dup, "X-host-foo", *host_->metadata(), "foo", "bar"); | ||
| } |
There was a problem hiding this comment.
If you're only trying to verify that you can modify headers in the upstream extension why the complexity here? Why not just a single header?
There was a problem hiding this comment.
The idea is that I don't want to add test case because
"Envoy can do this in this current implementation" but
"This is real world requirement"
Also this can acts an example for user who want to rewrite header base on per upstream attribute like #13897
Does it make sense?
| // This test case should be rewritten once upstream http | ||
| // filters(https://github.com/envoyproxy/envoy/issues/10455) is landed. |
There was a problem hiding this comment.
If this is something that we want to support and validate via a test it seems like we should keep this test for perpetuity - just because you'd rewrite your extension to be a HTTP filter instead it doesn't mean everyone else would.
There was a problem hiding this comment.
As I explained in the other comment: This is an unfortunate constraint。
I am happy to refactor my upstream extension if upstream HTTP filter could achieve the goal providing alternative api.
So consider this as soft requirement when you are working on it
|
gentle ping @alyssawilk |
alyssawilk
left a comment
There was a problem hiding this comment.
I agree that it feels clear that this functionality will stick around. I will say given how often Envoy APIs shift around it isn't terrible to have a canonical example, so that if API / factory changes happen there's also a canonical transformation PR, if that makes sense? Basically don't know if it's necessary but I'm not averse.
Either way, sorry for the lag, and here's some thoughts on how we can limit code duplication and tighten it up a bit :-)
test/integration/cluster_upstream_extension_integration_test.cc
Outdated
Show resolved
Hide resolved
test/integration/cluster_upstream_extension_integration_test.cc
Outdated
Show resolved
Hide resolved
test/integration/cluster_upstream_extension_integration_test.cc
Outdated
Show resolved
Hide resolved
test/integration/cluster_upstream_extension_integration_test.cc
Outdated
Show resolved
Hide resolved
test/integration/cluster_upstream_extension_integration_test.cc
Outdated
Show resolved
Hide resolved
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
lambdai
left a comment
There was a problem hiding this comment.
Thank you @alyssawilk
Now the extension is a single header file. It is much cleaner for the test.
test/integration/cluster_upstream_extension_integration_test.cc
Outdated
Show resolved
Hide resolved
test/integration/cluster_upstream_extension_integration_test.cc
Outdated
Show resolved
Hide resolved
test/integration/cluster_upstream_extension_integration_test.cc
Outdated
Show resolved
Hide resolved
test/integration/cluster_upstream_extension_integration_test.cc
Outdated
Show resolved
Hide resolved
test/integration/cluster_upstream_extension_integration_test.cc
Outdated
Show resolved
Hide resolved
alyssawilk
left a comment
There was a problem hiding this comment.
Cool, much cleaner, thanks!
Just two more comments and you're good to go.
| void resetStream() override { sub_upstream_.resetStream(); } | ||
|
|
||
| private: | ||
| Extensions::Upstreams::Http::Http::HttpUpstream sub_upstream_; |
There was a problem hiding this comment.
Oh, I was thinking if you inherit from the HTTP upstream rather than wrap it, you can remove all the wrapper functions (which simply call sub_upstream_.function). WDYT?
There was a problem hiding this comment.
Updated. The new shape is less error prone for this task. Thanks!
test/integration/cluster_upstream_extension_integration_test.cc
Outdated
Show resolved
Hide resolved
Signed-off-by: Yuchen Dai <silentdai@gmail.com>
…3915) Add extra test case to guard that cluster upstream extension support header rewrite. Signed-off-by: Yuchen Dai <silentdai@gmail.com> Signed-off-by: Qin Qin <qqin@google.com>
Commit Message:
Add extra test case to guard that cluster upstream extension support header rewrite.
Additional Description:
Risk Level: LOW
Testing: Integration test
Docs Changes:
Release Notes:
Platform Specific Features: