Skip to content
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

Merged
merged 4 commits into from
Apr 12, 2018

Conversation

hennna
Copy link
Contributor

@hennna hennna commented Apr 10, 2018

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

Network::Address::IpVersion::v4);

EXPECT_CALL(listener_factory_, createListenSocket(_, _, true));
manager_->addOrUpdateListener(parseListenerFromV2Yaml(yaml), true);
Copy link
Contributor Author

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?

Copy link
Member

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?

dnoe
dnoe previously approved these changes Apr 11, 2018
Copy link
Member

@mattklein123 mattklein123 left a 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 {
Copy link
Member

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

Copy link
Contributor Author

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"));
Copy link
Member

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)

@dnoe dnoe self-assigned this Apr 12, 2018
@mattklein123 mattklein123 merged commit b17b2cb into envoyproxy:master Apr 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants