mirror of https://github.com/status-im/consul.git
00b5b0a0a2
The duo of `makeUpstreamFilterChainForDiscoveryChain` and `makeListenerForDiscoveryChain` were really hard to reason about, and led to concealing a bug in their branching logic. There were several issues here: - They tried to accomplish too much: determining filter name, cluster name, and whether RDS should be used. - They embedded logic to handle significantly different kinds of upstream listeners (passthrough, prepared query, typical services, and catch-all) - They needed to coalesce different data sources (Upstream and CompiledDiscoveryChain) Rather than handling all of those tasks inside of these functions, this PR pulls out the RDS/clusterName/filterName logic. This refactor also fixed a bug with the handling of [UpstreamDefaults](https://www.consul.io/docs/connect/config-entries/service-defaults#defaults). These defaults get stored as UpstreamConfig in the proxy snapshot with a DestinationName of "*", since they apply to all upstreams. However, this wildcard destination name must not be used when creating the name of the associated upstream cluster. The coalescing logic in the original functions here was in some situations creating clusters with a `*.` prefix, which is not a valid destination. |
||
---|---|---|
.. | ||
proxysupport | ||
testdata | ||
clusters.go | ||
clusters_test.go | ||
config.go | ||
config_test.go | ||
delta.go | ||
delta_test.go | ||
endpoints.go | ||
endpoints_test.go | ||
envoy_versioning.go | ||
envoy_versioning_test.go | ||
failover_math.go | ||
failover_math_test.go | ||
golden_test.go | ||
listeners.go | ||
listeners_ingress.go | ||
listeners_test.go | ||
naming.go | ||
net_fallback.go | ||
net_linux.go | ||
protocol_trace.go | ||
rbac.go | ||
rbac_test.go | ||
resources.go | ||
response.go | ||
routes.go | ||
routes_test.go | ||
server.go | ||
server_oss.go | ||
testing.go | ||
xds.go | ||
xds_protocol_helpers_test.go | ||
z_xds_packages.go | ||
z_xds_packages_test.go |