open-consul/agent/proxycfg
Freddy eb2b40b22d
Update filter chain creation for sidecar/ingress listeners (#11245)
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.
2021-11-09 14:43:51 -07:00
..
connect_proxy.go structs: rename the last helper method. 2021-09-29 11:48:38 -04:00
ingress_gateway.go Add support for enabling connect-based ingress TLS per listener. 2021-10-19 20:58:28 +01:00
manager.go agent: ensure that most agent behavior correctly respects partition configuration (#10880) 2021-08-19 15:09:42 -05:00
manager_test.go Store GatewayKey in proxycfg snapshot for re-use 2021-11-01 13:58:53 -06:00
mesh_gateway.go Store GatewayKey in proxycfg snapshot for re-use 2021-11-01 13:58:53 -06:00
mesh_gateway_oss.go Update mesh gateway proxy watches for partitions 2021-10-27 09:03:56 -06:00
proxycfg.go Proxy Config Manager (#4729) 2018-10-10 16:55:34 +01:00
snapshot.go Exclude default partition from GatewayKey string 2021-11-01 14:45:52 -06:00
state.go Update filter chain creation for sidecar/ingress listeners (#11245) 2021-11-09 14:43:51 -07:00
state_test.go Update filter chain creation for sidecar/ingress listeners (#11245) 2021-11-09 14:43:51 -07:00
terminating_gateway.go Store GatewayKey in proxycfg snapshot for re-use 2021-11-01 13:58:53 -06:00
testing.go xds: prefer fed state gateway definitions if they're fresher (#11522) 2021-11-09 16:45:36 +00:00
upstreams.go Update locality check in proxycfg 2021-11-01 13:58:53 -06:00