consul/agent/xds
R.B. Boyer e3cd4a8539
connect: use stronger validation that ingress gateways have compatible protocols defined for their upstreams (#8470)
Fixes #8466

Since Consul 1.8.0 there was a bug in how ingress gateway protocol
compatibility was enforced. At the point in time that an ingress-gateway
config entry was modified the discovery chain for each upstream was
checked to ensure the ingress gateway protocol matched. Unfortunately
future modifications of other config entries were not validated against
existing ingress-gateway definitions, such as:

1. create tcp ingress-gateway pointing to 'api' (ok)
2. create service-defaults for 'api' setting protocol=http (worked, but not ok)
3. create service-splitter or service-router for 'api' (worked, but caused an agent panic)

If you were to do these in a different order, it would fail without a
crash:

1. create service-defaults for 'api' setting protocol=http (ok)
2. create service-splitter or service-router for 'api' (ok)
3. create tcp ingress-gateway pointing to 'api' (fail with message about
   protocol mismatch)

This PR introduces the missing validation. The two new behaviors are:

1. create tcp ingress-gateway pointing to 'api' (ok)
2. (NEW) create service-defaults for 'api' setting protocol=http ("ok" for back compat)
3. (NEW) create service-splitter or service-router for 'api' (fail with
   message about protocol mismatch)

In consideration for any existing users that may be inadvertently be
falling into item (2) above, that is now officiall a valid configuration
to be in. For anyone falling into item (3) above while you cannot use
the API to manufacture that scenario anymore, anyone that has old (now
bad) data will still be able to have the agent use them just enough to
generate a new agent/proxycfg error message rather than a panic.
Unfortunately we just don't have enough information to properly fix the
config entries.
2020-08-12 11:19:20 -05:00
..
proxysupport xds: add support for envoy 1.15.0 and drop support for 1.11.x (#8424) 2020-07-31 15:52:49 -05:00
testdata xds: add support for envoy 1.15.0 and drop support for 1.11.x (#8424) 2020-07-31 15:52:49 -05:00
clusters.go xds: version sniff envoy and switch regular expressions from 'regex' to 'safe_regex' on newer envoy versions (#8222) 2020-07-09 17:04:51 -05:00
clusters_test.go xds: add support for envoy 1.15.0 and drop support for 1.11.x (#8424) 2020-07-31 15:52:49 -05:00
config.go connect: upgrade github.com/envoyproxy/go-control-plane to v0.9.5 (#8165) 2020-06-23 15:19:56 -05:00
config_test.go Enable gateways to resolve hostnames to IPv4 addresses (#7999) 2020-06-03 15:28:45 -06:00
endpoints.go xds: version sniff envoy and switch regular expressions from 'regex' to 'safe_regex' on newer envoy versions (#8222) 2020-07-09 17:04:51 -05:00
endpoints_test.go xds: add support for envoy 1.15.0 and drop support for 1.11.x (#8424) 2020-07-31 15:52:49 -05:00
envoy_versioning.go xds: add support for envoy 1.15.0 and drop support for 1.11.x (#8424) 2020-07-31 15:52:49 -05:00
envoy_versioning_test.go xds: version sniff envoy and switch regular expressions from 'regex' to 'safe_regex' on newer envoy versions (#8222) 2020-07-09 17:04:51 -05:00
failover_math.go connect: fix failover through a mesh gateway to a remote datacenter (#6259) 2019-08-05 13:30:35 -05:00
failover_math_test.go connect: fix failover through a mesh gateway to a remote datacenter (#6259) 2019-08-05 13:30:35 -05:00
golden_test.go xds: version sniff envoy and switch regular expressions from 'regex' to 'safe_regex' on newer envoy versions (#8222) 2020-07-09 17:04:51 -05:00
listeners.go connect: use stronger validation that ingress gateways have compatible protocols defined for their upstreams (#8470) 2020-08-12 11:19:20 -05:00
listeners_test.go xds: add support for envoy 1.15.0 and drop support for 1.11.x (#8424) 2020-07-31 15:52:49 -05:00
naming.go connect: generate the full SNI names for discovery targets in the compiler rather than in the xds package (#6340) 2019-08-19 13:03:03 -05:00
response.go connect: upgrade github.com/envoyproxy/go-control-plane to v0.9.5 (#8165) 2020-06-23 15:19:56 -05:00
routes.go connect: use stronger validation that ingress gateways have compatible protocols defined for their upstreams (#8470) 2020-08-12 11:19:20 -05:00
routes_test.go xds: add support for envoy 1.15.0 and drop support for 1.11.x (#8424) 2020-07-31 15:52:49 -05:00
server.go xds: add support for envoy 1.15.0 and drop support for 1.11.x (#8424) 2020-07-31 15:52:49 -05:00
server_oss.go Updates to Config Entries and Connect for Namespaces (#7116) 2020-01-24 10:04:58 -05:00
server_test.go Fix a bunch of unparam lint issues 2020-06-24 13:00:14 -04:00
testing.go connect: upgrade github.com/envoyproxy/go-control-plane to v0.9.5 (#8165) 2020-06-23 15:19:56 -05:00
xds.go Remove unused customEDSClusterJSON 2020-03-27 15:38:16 -04:00