From bf96d536d9c7c00705b04d1824f29f0d128f3f31 Mon Sep 17 00:00:00 2001 From: freddygv Date: Wed, 17 Mar 2021 15:32:52 -0600 Subject: [PATCH] Upstreams loop is only for prepared queries and they are not CentrallyConfigured --- agent/xds/listeners.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/agent/xds/listeners.go b/agent/xds/listeners.go index 5b223306bb..7e419f2447 100644 --- a/agent/xds/listeners.go +++ b/agent/xds/listeners.go @@ -242,9 +242,9 @@ func (s *Server) listenersFromSnapshotConnectProxy(cInfo connectionInfo, cfgSnap resources = append(resources, outboundListener) } + // Looping over explicit upstreams is only needed for prepared queries because they do not have discovery chains for id, u := range cfgSnap.ConnectProxy.UpstreamConfig { - if _, ok := cfgSnap.ConnectProxy.DiscoveryChain[id]; ok && u.DestinationType != structs.UpstreamDestTypePreparedQuery { - // This upstream is already covered above + if u.DestinationType != structs.UpstreamDestTypePreparedQuery { continue } @@ -258,10 +258,7 @@ func (s *Server) listenersFromSnapshotConnectProxy(cInfo connectionInfo, cfgSnap if u.LocalBindAddress != "" { address = u.LocalBindAddress } - // This is the case where upstream config is centralized but no port was specified - if u.LocalBindPort == 0 { - continue - } + upstreamListener := makeListener(id, address, u.LocalBindPort, envoy_core_v3.TrafficDirection_OUTBOUND) filterChain, err := s.makeUpstreamFilterChainForDiscoveryChain(