consul/agent/configentry
Derek Menteer 0094dbf312
Fix incorrect protocol for transparent proxy upstreams. (#17894)
This PR fixes a bug that was introduced in:
https://github.com/hashicorp/consul/pull/16021

A user setting a protocol in proxy-defaults would cause tproxy implicit
upstreams to not honor the upstream service's protocol set in its
`ServiceDefaults.Protocol` field, and would instead always use the
proxy-defaults value.

Due to the fact that upstreams configured with "tcp" can successfully contact
upstream "http" services, this issue was not recognized until recently (a
proxy-defaults with "tcp" and a listening service with "http" would make
successful requests, but not the opposite).

As a temporary work-around, users experiencing this issue can explicitly set
the protocol on the `ServiceDefaults.UpstreamConfig.Overrides`, which should
take precedence.

The fix in this PR removes the proxy-defaults protocol from the wildcard
upstream that tproxy uses to configure implicit upstreams. When the protocol
was included, it would always overwrite the value during discovery chain
compilation, which was not correct. The discovery chain compiler also consumes
proxy defaults to determine the protocol, so simply excluding it from the
wildcard upstream config map resolves the issue.
2023-07-05 09:32:10 -05:00
..
compare.go extract some config entry helpers into package (#17434) 2023-05-23 12:15:30 -05:00
compare_test.go extract some config entry helpers into package (#17434) 2023-05-23 12:15:30 -05:00
config_entry.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
discoverychain.go Add default resolvers to disco chains based on the default sameness group (#16837) 2023-03-31 14:35:56 -04:00
doc.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00
merge_service_config.go peering: ensure that merged central configs of peered upstreams for partitioned downstreams work (#17179) 2023-04-28 12:36:08 -05:00
merge_service_config_test.go peering: ensure that merged central configs of peered upstreams for partitioned downstreams work (#17179) 2023-04-28 12:36:08 -05:00
resolve.go Fix incorrect protocol for transparent proxy upstreams. (#17894) 2023-07-05 09:32:10 -05:00
resolve_test.go Permissive mTLS (#17035) 2023-04-19 14:45:00 -05:00
service_config.go copyright headers for agent folder (#16704) 2023-03-28 14:39:22 -04:00