-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
address: use resolveProtoAddress to resolve listener addresses #3039
Conversation
Signed-off-by: Henna Huang <[email protected]>
Network::Address::IpVersion::v4); | ||
|
||
EXPECT_CALL(listener_factory_, createListenSocket(_, _, true)); | ||
manager_->addOrUpdateListener(parseListenerFromV2Yaml(yaml), true); |
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.
This doesn't test that the resolved address matches what is expected. Is that necessary?
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.
Can you use a mock resolver or something to ensure we're at least going through the resolutino process?
Signed-off-by: Henna Huang <[email protected]>
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.
nice, just some test nits. thank you.
@@ -123,6 +127,13 @@ class ListenerManagerImplWithRealFiltersTest : public ListenerManagerImplTest { | |||
} | |||
}; | |||
|
|||
class MockAddressResolver : public Network::Address::Resolver { |
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.
test nit: I would move this into the common mocks as it is generally useful
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 the review. done.
Network::Address::IpVersion::v4); | ||
|
||
MockAddressResolver mock_resolver; | ||
EXPECT_CALL(mock_resolver, name()).WillRepeatedly(Return("envoy.mock.resolver")); |
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.
I would probably just setup a default ON_CALL in the mock for this one. (EXPECT_CALL/WillRepeatedly is a bit of an anti-pattern)
Signed-off-by: Henna Huang <[email protected]>
Signed-off-by: Henna Huang <[email protected]>
Signed-off-by: Henna Huang [email protected]
title: Use resolveProtoAddress to resolve listener addresses
Description:
In #1835, support for synchronous address resolvers and upstream address resolution were added. This PR extends support to resolving listener addresses.
Risk Level: Low
Testing:
Existing tests pass.
listener_impl test cases added.
Docs Changes:
n/a
Release Notes:
n/a