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

Listener ECDS: Adding config provider manager implemantion for listener filter #20560

Merged
merged 27 commits into from
May 2, 2022

Conversation

yanjunxiang-google
Copy link
Contributor

@yanjunxiang-google yanjunxiang-google commented Mar 28, 2022

Problem description:
Listener ECDS: Adding FilterConfigProviderManagerImpl class implemantion for listener filter.
This is the 3rd PR to support listener filter ECDS as in issue: #20049. It includes:

  1. The class definition of ListenerFilterConfigProviderManagerImpl.
  2. Moving getMessage() method to the base class to avoid duplicated code.
  3. Unit test cases for ListenerFilterConfigProviderManagerImpl.

Build:
passed

Testing:
passed

Release Notes:
N/A

Issues: ecds: add support for listener filters #20049

Signed-off-by: Yanjun Xiang yanjunxiang@google.com

Commit Message:
Additional Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

…ion for Listener filter.

This is the 3rd PR to support listener ECDS. It includes:
1) The class definition of ListenerFilterConfigProviderManagerImpl.
2) Moving getMessage() method to the base class to avoid duplicated code.
3) Unit test cases for ListenerFilterConfigProviderManagerImpl.

Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
@yanjunxiang-google
Copy link
Contributor Author

/assign @adisuissa @kyessenov @yanavlasov

Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
@yanjunxiang-google yanjunxiang-google changed the title Listener ECDS: Adding FilterConfigProviderManagerImpl class implemantion for listener filter Listener ECDS: Adding config provider manager implemantion for listener filter Mar 29, 2022
Copy link
Contributor

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this, mostly small things.

envoy/filter/config_provider_manager.h Outdated Show resolved Hide resolved
source/common/filter/config_discovery_impl.cc Outdated Show resolved Hide resolved
source/extensions/filters/listener/tls_inspector/BUILD Outdated Show resolved Hide resolved
test/common/filter/config_discovery_impl_test.cc Outdated Show resolved Hide resolved
test/common/filter/config_discovery_impl_test.cc Outdated Show resolved Hide resolved
test/common/filter/config_discovery_impl_test.cc Outdated Show resolved Hide resolved
source/common/filter/config_discovery_impl.h Outdated Show resolved Hide resolved
@kyessenov
Copy link
Contributor

For something like this, an xDS integration test would be useful. There is one for HTTP, so it can be copied and adapted fairly easy.

@yanjunxiang-google
Copy link
Contributor Author

For something like this, an xDS integration test would be useful. There is one for HTTP, so it can be copied and adapted fairly easy.

Yes, that's planned.

This PR just added a ListenerFilterConfigManagerImpl definition. It's not used any where. In the planned next PR, I will be creating an object of it in class ListenerManagerImpl, and using it to create listener filter factories, and build listener filter chain. In that PR, I will be extending the current test/integration/extension_discovery_integration_test.cc to test listener ECDS functionality end-to-end.

Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
…listener

Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
@yanjunxiang-google
Copy link
Contributor Author

/retest

@repokitteh-read-only
Copy link

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #20560 (comment) was created by @yanjunxiang-google.

see: more, trace.

@yanjunxiang-google
Copy link
Contributor Author

/assign @htuch

Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
@yanjunxiang-google
Copy link
Contributor Author

@adisuissa @kyessenov PTAL

Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
Copy link
Contributor

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, overall LGTM.
@soulxu can you take another look.

@@ -29,6 +29,13 @@ class FilterConfigSubscription;

using FilterConfigSubscriptionSharedPtr = std::shared_ptr<FilterConfigSubscription>;

// These helper functions throw exceptions. Thus can not be defined in .h files.
void validateProtoConfigDefaultFactoryHelper(const bool null_default_factory,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try having functions which are scoped inside a class or are in an empty namespace.
The helper functions should probably be either private or protected functions in one of the classes below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@soulxu
Copy link
Member

soulxu commented Apr 22, 2022

Thanks, overall LGTM. @soulxu can you take another look.

overall LGTM also! except for the listener filter matcher #20560 (comment)

Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
@soulxu
Copy link
Member

soulxu commented Apr 25, 2022

@yanjunxiang-google thanks! that is perfect. Then this is LGTM now.

Copy link
Contributor

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM modulo test nits.
@htuch can you PTAL?

test/common/filter/config_discovery_impl_test.cc Outdated Show resolved Hide resolved
test/common/filter/config_discovery_impl_test.cc Outdated Show resolved Hide resolved
test/integration/filters/test_listener_filter.cc Outdated Show resolved Hide resolved
Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
@yanjunxiang-google
Copy link
Contributor Author

@htuch @kyessenov PTAL

Copy link
Contributor

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, left a small nit.

Config::Utility::getFactoryByType<Server::Configuration::NamedHttpFilterConfigFactory>(
proto_config);
if (default_factory == nullptr) {
void FilterConfigProviderManagerImplBase::validateProtoConfigDefaultFactory(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC both this method and validateProtoConfigTypeUrl are only called once.
Is there a plan to call them in other places in later PRs? If not, then we should just inline their contents in the call place.

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 comments.

This method throw exception. Envoy CI scripts doesn't allow throw exception in .h files.

Copy link
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I think @kyessenov can do final pass/merge (now as a maintainer). Generally I'd also ask for a non-Googler, but this is mostly an internal change and consistent with previous work on ECDS, so won't insist on that unless someone feels strongly in favor.

Copy link
Contributor

@adisuissa adisuissa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@adisuissa
Copy link
Contributor

LGTM. I think @kyessenov can do final pass/merge (now as a maintainer). Generally I'd also ask for a non-Googler, but this is mostly an internal change and consistent with previous work on ECDS, so won't insist on that unless someone feels strongly in favor.

Matt volunteered to do a final pass, once @kyessenov LGTM's this PR.

@yanjunxiang-google
Copy link
Contributor Author

yanjunxiang-google commented May 2, 2022

/assign @mattklein123

@repokitteh-read-only
Copy link

neither of Thanks, for, help, reviewing! can be assigned to this issue.

🐱

Caused by: a #20560 (comment) was created by @yanjunxiang-google.

see: more, trace.

@yanjunxiang-google
Copy link
Contributor Author

LGTM. I think @kyessenov can do final pass/merge (now as a maintainer). Generally I'd also ask for a non-Googler, but this is mostly an internal change and consistent with previous work on ECDS, so won't insist on that unless someone feels strongly in favor.

Matt volunteered to do a final pass, once @kyessenov LGTM's this PR.

Thanks @mattklein123 for help reviewing!

@mattklein123 mattklein123 self-assigned this May 2, 2022
@yanjunxiang-google
Copy link
Contributor Author

yanjunxiang-google commented May 2, 2022

For reviewers:

This PR added the building blocks to support listener filter ECDS. But it is not hooked into listener manager code yet (e.g.

ProdListenerComponentFactory::createListenerFilterFactoryList_(
). The hooking to the listener manager and corresponding code, also the listener filter ECDS integration test, will be done in the coming PR.

@mattklein123 mattklein123 merged commit 2f7f14b into envoyproxy:main May 2, 2022
ravenblackx pushed a commit to ravenblackx/envoy that referenced this pull request Jun 8, 2022
…er filter (envoyproxy#20560)

This is the 3rd PR to support listener ECDS. It includes:
1) The class definition of ListenerFilterConfigProviderManagerImpl.
2) Moving getMessage() method to the base class to avoid duplicated code.
3) Unit test cases for ListenerFilterConfigProviderManagerImpl.

Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
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.

9 participants