mirror of https://github.com/hashicorp/consul
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. |
||
---|---|---|
.. | ||
connect_proxy.go | ||
ingress_gateway.go | ||
manager.go | ||
manager_test.go | ||
mesh_gateway.go | ||
mesh_gateway_oss.go | ||
proxycfg.go | ||
snapshot.go | ||
state.go | ||
state_test.go | ||
terminating_gateway.go | ||
testing.go | ||
upstreams.go |