Skip to content

listener: detect filter chains with overlapping matching rules.#6906

Merged
htuch merged 1 commit intoenvoyproxy:masterfrom
PiotrSikora:overlapping_rules
May 13, 2019
Merged

listener: detect filter chains with overlapping matching rules.#6906
htuch merged 1 commit intoenvoyproxy:masterfrom
PiotrSikora:overlapping_rules

Conversation

@PiotrSikora
Copy link
Copy Markdown
Contributor

This is an alternative to #6022.

Fixes #6905.

Signed-off-by: Piotr Sikora piotrsikora@google.com

This is an alternative to envoyproxy#6022.

Fixes envoyproxy#6905.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>
@PiotrSikora
Copy link
Copy Markdown
Contributor Author

cc @htuch @howardjohn

Copy link
Copy Markdown
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 modulo one comment. Thinking about this, it would be nice to make "not-implemented-yet" a proto annotation and write this check once at proto ingestion time. We could just file an issue for now, WDYT?

for (const auto& filter_chain : config.filter_chains()) {
const auto& filter_chain_match = filter_chain.filter_chain_match();
if (!filter_chain_match.address_suffix().empty() || filter_chain_match.has_suffix_len() ||
filter_chain_match.source_prefix_ranges_size() || filter_chain_match.source_ports_size()) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should there be tests for each of these cases? Not sure if it's worth the boilerplate, but it's a bit weird to have explicit rejections that we don't test.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think it's not worth the extra tests, since those are already unsupported edge cases, and we have the line coverage from one of them, but I'm happy to add them if you prefer, let me know.

@PiotrSikora
Copy link
Copy Markdown
Contributor Author

Thinking about this, it would be nice to make "not-implemented-yet" a proto annotation and write this check once at proto ingestion time. We could just file an issue for now, WDYT?

Agreed, see discussion in #6022 :)

Copy link
Copy Markdown
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.

Thanks!

@htuch htuch merged commit a87c61e into envoyproxy:master May 13, 2019
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.

Provide better error logs for filter chains with overlapping rules

2 participants