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: allow setting only a default filter chain #14025

Merged
merged 6 commits into from
Nov 19, 2020
Merged

listener: allow setting only a default filter chain #14025

merged 6 commits into from
Nov 19, 2020

Conversation

tbarrella
Copy link
Contributor

I didn't add anything to the release notes because it looks like specifying a default filter chain will be new for the upcoming release and this is fixing a bug

Commit Message:
listener: allow setting only a default filter chain

Signed-off-by: Taylor Barrella tabarr@google.com

Additional Description:
Risk Level: Low
Testing: New unit test fails without these changes. I also searched for occurrences of .filter_chains() and only found them in listener_impl.cc and test files
Docs Changes: N/A
Release Notes:
Fixes #13685

Signed-off-by: Taylor Barrella <tabarr@google.com>
@tbarrella
Copy link
Contributor Author

cc @lambdai

Copy link
Contributor

@lambdai lambdai left a comment

Choose a reason for hiding this comment

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

Thanks! Almost there!

Could you fix and merge master to see if coverage passes? I don't think transport socket coverage should be impacted by your change

source/server/listener_impl.cc Outdated Show resolved Hide resolved
source/server/listener_impl.cc Outdated Show resolved Hide resolved
Signed-off-by: Taylor Barrella <tabarr@google.com>
Signed-off-by: Taylor Barrella <tabarr@google.com>
@tbarrella tbarrella requested a review from lambdai November 16, 2020 19:32
Signed-off-by: Taylor Barrella <tabarr@google.com>
Signed-off-by: Taylor Barrella <tabarr@google.com>
lambdai
lambdai previously approved these changes Nov 17, 2020
Copy link
Contributor

@lambdai lambdai left a comment

Choose a reason for hiding this comment

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

LGTM.
Thank you for the fix!

@tbarrella
Copy link
Contributor Author

/retest

@repokitteh-read-only
Copy link

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

🐱

Caused by: a #14025 (comment) was created by @tbarrella.

see: more, trace.

@mattklein123 mattklein123 self-assigned this Nov 18, 2020
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.

Thanks for fixing. One question.

/wait-any

@@ -55,6 +62,12 @@ bool needTlsInspector(const envoy::config::listener::v3::Listener& config) {
filter.name() == "envoy.listener.tls_inspector";
});
}

bool usesProxyProto(const envoy::config::listener::v3::Listener& config) {
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't this need to look like needTlsInspector with a search through all filter chains? I don't understand how you can only check the default or the first chain? Was this a bug that already existed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems this is the only file that checks use_proxy_proto, so maybe it was a bug/undocumented expectation. Not sure if the previous behavior should be modified in this change. I just realized it might be more conservative to change the condition from config.has_default_filter_chain() to config.filter_chains().empty() though

Copy link
Member

Choose a reason for hiding this comment

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

To me this is a bug as I don't think it makes any sense. If we don't want to fix this now I would make no changes here and then fix it in a follow up?

If we auto inject proxy proto I think all filter chains should probably be asking for it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense to me. I'm reluctant to change two behaviors in one commit; opened #14085 for now

Copy link
Contributor

Choose a reason for hiding this comment

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

@mattklein123 It's an invalid config if partial of the filter chain set use proxy proto while other filter chain don't. We check the first filter chain here for back compatibility.

Copy link
Contributor

Choose a reason for hiding this comment

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

There is no enforcement at this moment. And don't add enforcement in this PR.
However, could you add the warning message?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't add a printed warning since deprecation should serve that purpose, but I added a comment referencing #14085

Copy link
Member

Choose a reason for hiding this comment

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

Given that none of this make any sense, do you want to just revert this part of the PR entirely? Also do we want a warning in a PR or do you want to do this as a follow up? Otherwise this change LGTM and thanks for the discussion here.

/wait-any

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 is still needed to avoid an indexing error when only a default filter chain is provided. I'd rather leave user-facing warnings etc. as a follow-up (part of the other issue) since this is consistent with existing behavior/isn't a regression or anything

Copy link
Member

Choose a reason for hiding this comment

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

OK fair enough. If you can fix all of ^ as a follow up that would be appreciated.

Signed-off-by: Taylor Barrella <tabarr@google.com>
@tbarrella
Copy link
Contributor Author

/retest

@repokitteh-read-only
Copy link

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

🐱

Caused by: a #14025 (comment) was created by @tbarrella.

see: more, trace.

@tbarrella
Copy link
Contributor Author

/retest

@repokitteh-read-only
Copy link

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

🐱

Caused by: a #14025 (comment) was created by @tbarrella.

see: more, trace.

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.

Thanks!

@mattklein123 mattklein123 merged commit 6be36de into envoyproxy:master Nov 19, 2020
@tbarrella tbarrella deleted the filter-chain branch November 19, 2020 17:36
andreyprezotto pushed a commit to andreyprezotto/envoy that referenced this pull request Nov 24, 2020
Signed-off-by: Taylor Barrella <tabarr@google.com>
qqustc pushed a commit to qqustc/envoy that referenced this pull request Nov 24, 2020
Signed-off-by: Taylor Barrella <tabarr@google.com>
Signed-off-by: Qin Qin <qqin@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.

Setting Default filter chain but no common filter chains should not "no filter chains specified" exception
3 participants