-
Notifications
You must be signed in to change notification settings - Fork 331
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(meshpassthrough): don't remove all filters chains (#11540)
While debugging the tests, I noticed a log entry: error adding listener 'outbound:passthrough:ipv6': no filter chains specified This leads to the case where the MeshPassthrough policy might consist of only IPv4 or IPv6-specific entries. In such cases, the current logic removes all filter chains and initializes a new, empty filter chain. If there’s no match for the specific IP protocol, the list could end up empty, which may cause Envoy to reject the configuration. I've added a change to check if there are rules for a specific IP protocol, and only trigger the logic if rules exist. --------- Signed-off-by: Lukasz Dziedziak <[email protected]>
- Loading branch information
Showing
4 changed files
with
139 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...ns/policies/meshpassthrough/plugin/v1alpha1/testdata/only-ipv4-rules.clusters.golden.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
resources: | ||
- name: meshpassthrough_192.168.0.0_80 | ||
resource: | ||
'@type': type.googleapis.com/envoy.config.cluster.v3.Cluster | ||
altStatName: meshpassthrough_192_168_0_0_80 | ||
connectTimeout: 5s | ||
lbPolicy: CLUSTER_PROVIDED | ||
name: meshpassthrough_192.168.0.0_80 | ||
type: ORIGINAL_DST |
47 changes: 47 additions & 0 deletions
47
...ns/policies/meshpassthrough/plugin/v1alpha1/testdata/only-ipv4-rules.listener.golden.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
resources: | ||
- name: outbound:passthrough:ipv4 | ||
resource: | ||
'@type': type.googleapis.com/envoy.config.listener.v3.Listener | ||
address: | ||
socketAddress: | ||
address: 0.0.0.0 | ||
portValue: 15001 | ||
filterChains: | ||
- filterChainMatch: | ||
destinationPort: 80 | ||
prefixRanges: | ||
- addressPrefix: 192.168.0.0 | ||
prefixLen: 32 | ||
transportProtocol: raw_buffer | ||
filters: | ||
- name: envoy.filters.network.tcp_proxy | ||
typedConfig: | ||
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy | ||
cluster: meshpassthrough_192.168.0.0_80 | ||
statPrefix: meshpassthrough_192_168_0_0_80 | ||
name: meshpassthrough_192.168.0.0_80 | ||
listenerFilters: | ||
- name: envoy.filters.listener.tls_inspector | ||
typedConfig: | ||
'@type': type.googleapis.com/envoy.extensions.filters.listener.tls_inspector.v3.TlsInspector | ||
- name: envoy.filters.listener.http_inspector | ||
typedConfig: | ||
'@type': type.googleapis.com/envoy.extensions.filters.listener.http_inspector.v3.HttpInspector | ||
name: outbound:passthrough:ipv4 | ||
trafficDirection: OUTBOUND | ||
- name: outbound:passthrough:ipv6 | ||
resource: | ||
'@type': type.googleapis.com/envoy.config.listener.v3.Listener | ||
address: | ||
socketAddress: | ||
address: '::' | ||
portValue: 15001 | ||
filterChains: | ||
- filters: | ||
- name: envoy.filters.network.tcp_proxy | ||
typedConfig: | ||
'@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy | ||
cluster: outbound:passthrough:ipv6 | ||
statPrefix: outbound_passthrough_ipv6 | ||
name: outbound:passthrough:ipv6 | ||
trafficDirection: OUTBOUND |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters