listener: implement disabled predicates (#10389)

Signed-off-by: Yuchen Dai <silentdai@gmail.com>

Mirrored from https://github.com/envoyproxy/envoy @ e6ce1909fd2f6d6c85faa892e09d5840b23774cb
master-ci-test
data-plane-api(CircleCI) 5 years ago
parent f35a1d3d6f
commit 927c1a8292
  1. 40
      envoy/api/v2/listener/listener_components.proto
  2. 40
      envoy/config/listener/v3/listener_components.proto

@ -209,9 +209,32 @@ message FilterChain {
string name = 7; string name = 7;
} }
// [#not-implemented-hide:]
// Listener filter chain match configuration. This is a recursive structure which allows complex // Listener filter chain match configuration. This is a recursive structure which allows complex
// nested match configurations to be built using various logical operators. // nested match configurations to be built using various logical operators.
//
// Examples:
//
// * Matches if the destination port is 3306.
//
// .. code-block:: yaml
//
// destination_port_range:
// start: 3306
// end: 3307
//
// * Matches if the destination port is 3306 or 15000.
//
// .. code-block:: yaml
//
// or_match:
// rules:
// - destination_port_range:
// start: 3306
// end: 3306
// - destination_port_range:
// start: 15000
// end: 15001
//
// [#next-free-field: 6] // [#next-free-field: 6]
message ListenerFilterChainMatchPredicate { message ListenerFilterChainMatchPredicate {
// A set of match configurations used for logical operations. // A set of match configurations used for logical operations.
@ -257,17 +280,8 @@ message ListenerFilter {
google.protobuf.Any typed_config = 3; google.protobuf.Any typed_config = 3;
} }
// [#not-implemented-hide:] // Optional match predicate used to disable the filter. The filter is enabled when this field is empty.
// Decide when to disable this listener filter on incoming traffic. // See :ref:`ListenerFilterChainMatchPredicate <envoy_api_msg_listener.ListenerFilterChainMatchPredicate>`
// Example: // for further examples.
// 0. always enable filter
// don't set `filter_disabled`
// 1. disable when the destination port is 3306
// rule.destination_port_range = Int32Range {start = 3306, end = 3307}
// 2. disable when the destination port is 3306 or 15000
// rule.or_match = MatchSet.rules [
// rule.destination_port_range = Int32Range {start = 3306, end = 3307},
// rule.destination_port_range = Int32Range {start = 15000, end = 15001},
// ]
ListenerFilterChainMatchPredicate filter_disabled = 4; ListenerFilterChainMatchPredicate filter_disabled = 4;
} }

@ -208,9 +208,32 @@ message FilterChain {
string name = 7; string name = 7;
} }
// [#not-implemented-hide:]
// Listener filter chain match configuration. This is a recursive structure which allows complex // Listener filter chain match configuration. This is a recursive structure which allows complex
// nested match configurations to be built using various logical operators. // nested match configurations to be built using various logical operators.
//
// Examples:
//
// * Matches if the destination port is 3306.
//
// .. code-block:: yaml
//
// destination_port_range:
// start: 3306
// end: 3307
//
// * Matches if the destination port is 3306 or 15000.
//
// .. code-block:: yaml
//
// or_match:
// rules:
// - destination_port_range:
// start: 3306
// end: 3306
// - destination_port_range:
// start: 15000
// end: 15001
//
// [#next-free-field: 6] // [#next-free-field: 6]
message ListenerFilterChainMatchPredicate { message ListenerFilterChainMatchPredicate {
option (udpa.annotations.versioning).previous_message_type = option (udpa.annotations.versioning).previous_message_type =
@ -267,17 +290,8 @@ message ListenerFilter {
google.protobuf.Any typed_config = 3; google.protobuf.Any typed_config = 3;
} }
// [#not-implemented-hide:] // Optional match predicate used to disable the filter. The filter is enabled when this field is empty.
// Decide when to disable this listener filter on incoming traffic. // See :ref:`ListenerFilterChainMatchPredicate <envoy_api_msg_config.listener.v3.ListenerFilterChainMatchPredicate>`
// Example: // for further examples.
// 0. always enable filter
// don't set `filter_disabled`
// 1. disable when the destination port is 3306
// rule.destination_port_range = Int32Range {start = 3306, end = 3307}
// 2. disable when the destination port is 3306 or 15000
// rule.or_match = MatchSet.rules [
// rule.destination_port_range = Int32Range {start = 3306, end = 3307},
// rule.destination_port_range = Int32Range {start = 15000, end = 15001},
// ]
ListenerFilterChainMatchPredicate filter_disabled = 4; ListenerFilterChainMatchPredicate filter_disabled = 4;
} }

Loading…
Cancel
Save