-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Listener: respect the connection balancer of the redirected listener #15842
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
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
3515417
techdebt: clean up connection_handler_impl dependency issue
lambdai 99bf747
pass all existing tests
lambdai 3b9aec1
add initial active_tcp_listener test
lambdai fd23487
fixing test
lambdai a5f26c9
llvm-11 formatter
lambdai aede638
fix format
lambdai fddcb00
fix quic
lambdai 0532563
ctidy
lambdai 4402535
Merge branch 'main' into rebalancer
lambdai 9ae7490
fix merge
lambdai ad29747
clean up
lambdai 4c28c5d
dont use atomic in mock
lambdai 01b8d5a
add integration test
lambdai 11ff0f3
Merge branch 'main' into rebalancer
lambdai cda38a9
cleanup
lambdai 3b25b2b
add version history
lambdai cafb8c5
more doc
lambdai 46e8732
doc
lambdai 381423a
sync api v4
lambdai 799d2e1
cleared -> disabled
lambdai be4033a
update proto inline comment
lambdai 726ba10
add ref
lambdai eeb6413
add comment and rename to virtual_listener
lambdai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
generated_api_shadow/envoy/config/listener/v4alpha/listener.proto
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
55 changes: 55 additions & 0 deletions
55
test/integration/filters/address_restore_listener_filter.cc
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
|
|
||
|
|
||
| #include "envoy/network/filter.h" | ||
| #include "envoy/network/listen_socket.h" | ||
| #include "envoy/server/filter_config.h" | ||
|
|
||
| #include "common/network/address_impl.h" | ||
| #include "common/network/utility.h" | ||
|
|
||
| namespace Envoy { | ||
|
|
||
| // The FakeOriginalDstListenerFilter restore desired local address without the dependency of OS. | ||
| class FakeOriginalDstListenerFilter : public Network::ListenerFilter { | ||
| public: | ||
| // Network::ListenerFilter | ||
| Network::FilterStatus onAccept(Network::ListenerFilterCallbacks& cb) override { | ||
| FANCY_LOG(debug, "in FakeOriginalDstListenerFilter::onAccept"); | ||
| Network::ConnectionSocket& socket = cb.socket(); | ||
| socket.addressProvider().restoreLocalAddress( | ||
| std::make_shared<Network::Address::Ipv4Instance>("127.0.0.2", 80)); | ||
| FANCY_LOG(debug, "current local socket address is {} restored = {}", | ||
| socket.addressProvider().localAddress()->asString(), | ||
| socket.addressProvider().localAddressRestored()); | ||
| return Network::FilterStatus::Continue; | ||
| } | ||
| }; | ||
|
|
||
| class FakeOriginalDstListenerFilterConfigFactory | ||
| : public Server::Configuration::NamedListenerFilterConfigFactory { | ||
| public: | ||
| // NamedListenerFilterConfigFactory | ||
| Network::ListenerFilterFactoryCb createListenerFilterFactoryFromProto( | ||
| const Protobuf::Message&, | ||
| const Network::ListenerFilterMatcherSharedPtr& listener_filter_matcher, | ||
| Server::Configuration::ListenerFactoryContext&) override { | ||
| return [listener_filter_matcher](Network::ListenerFilterManager& filter_manager) -> void { | ||
| filter_manager.addAcceptFilter(listener_filter_matcher, | ||
| std::make_unique<FakeOriginalDstListenerFilter>()); | ||
| }; | ||
| } | ||
|
|
||
| ProtobufTypes::MessagePtr createEmptyConfigProto() override { | ||
| return ProtobufTypes::MessagePtr{new Envoy::ProtobufWkt::Struct()}; | ||
| } | ||
|
|
||
| std::string name() const override { | ||
| // This fake original_dest should be used only in integration test! | ||
| return "envoy.filters.listener.original_dst"; | ||
| } | ||
| }; | ||
|
|
||
| static Registry::RegisterFactory<FakeOriginalDstListenerFilterConfigFactory, | ||
| Server::Configuration::NamedListenerFilterConfigFactory> | ||
| register_; | ||
| } // namespace Envoy |
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.