-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Provide better error logs for filter chains with overlapping rules #6905
Copy link
Copy link
Closed
Labels
enhancementFeature requests. Not bugs or questions.Feature requests. Not bugs or questions.
Milestone
Description
Description:
There are 2 configs included:
config_exact.yamlwith 2 filter chains forexample.com,config_overlapping.yamlwith 2 filter chains, one forexample.com, and another forexample.comandwww.example.com.
The original detection mechanism for conflicting filter chains from #3217 is based on MessageUtil::hash(), which means that it can only detect exact duplicates of complete filter chain messages, but it cannot detect duplicates in the repeated fields that can have multiple values (e.g. server_names).
The extra detection that was added in #6022 is catching those now (even though it was added for a different reason - to detect use of defined, but unimplemented fields, since it was circumventing the detection based on MessageUtil::hash()), but it returns slightly confusing error.
Repro steps:
bazel-bin/source/exe/envoy-static -c /tmp/configs/config_exact.yaml
[...]
error adding listener '0.0.0.0:9443': multiple filter chains with the same matching rules are defined
bazel-bin/source/exe/envoy-static -c /tmp/configs/config_overlapping.yaml
[...]
error adding listener '0.0.0.0:9443': multiple filter chains with effectively equivalent matching rules are defined
Config:
$ cat /tmp/configs/config_exact.yaml
admin:
access_log_path: /dev/null
address:
socket_address:
address: 127.0.0.1
port_value: 9901
static_resources:
listeners:
- name: default_listener
address:
socket_address:
address: 0.0.0.0
port_value: 9443
filter_chains:
- filter_chain_match:
server_names: ["example.com"]
- filters:
- name: envoy.tcp_proxy
config:
stat_prefix: stats
cluster: default_cluster
- filter_chain_match:
server_names: ["example.com"]
filters:
- name: envoy.tcp_proxy
config:
stat_prefix: stats
cluster: default_cluster
clusters:
- name: default_cluster
connect_timeout: 1s
type: STATIC
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: default_cluster
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 127.0.0.1
port_value: 9902
$ cat /tmp/configs/config_overlapping.yaml
admin:
access_log_path: /dev/null
address:
socket_address:
address: 127.0.0.1
port_value: 9901
static_resources:
listeners:
- name: default_listener
address:
socket_address:
address: 0.0.0.0
port_value: 9443
filter_chains:
- filter_chain_match:
server_names: ["example.com", "www.example.com"]
- filters:
- name: envoy.tcp_proxy
config:
stat_prefix: stats
cluster: default_cluster
- filter_chain_match:
server_names: ["example.com"]
filters:
- name: envoy.tcp_proxy
config:
stat_prefix: stats
cluster: default_cluster
clusters:
- name: default_cluster
connect_timeout: 1s
type: STATIC
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: default_cluster
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 127.0.0.1
port_value: 9902
Related:
istio/istio#13717
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementFeature requests. Not bugs or questions.Feature requests. Not bugs or questions.