From 84a5f91a081dffae0a8c72a658821a5fdf205946 Mon Sep 17 00:00:00 2001 From: freddygv Date: Tue, 13 Apr 2021 10:17:11 -0600 Subject: [PATCH 1/2] Avoid nil panic when cluster config doesn't exist --- agent/xds/clusters.go | 1 + 1 file changed, 1 insertion(+) diff --git a/agent/xds/clusters.go b/agent/xds/clusters.go index db9910437..ff36277da 100644 --- a/agent/xds/clusters.go +++ b/agent/xds/clusters.go @@ -59,6 +59,7 @@ func (s *Server) clustersFromSnapshotConnectProxy(cfgSnap *proxycfg.ConfigSnapsh // In transparent proxy mode there needs to be a passthrough cluster for traffic going to destinations // that aren't in Consul's catalog. if cfgSnap.Proxy.Mode == structs.ProxyModeTransparent && + cfgSnap.ConnectProxy.ClusterConfig != nil && !cfgSnap.ConnectProxy.ClusterConfig.TransparentProxy.CatalogDestinationsOnly { clusters = append(clusters, &envoy_cluster_v3.Cluster{ From 911d7dcaa8b84884e6b23814a5496516edd332ea Mon Sep 17 00:00:00 2001 From: freddygv Date: Tue, 13 Apr 2021 10:19:59 -0600 Subject: [PATCH 2/2] Remove todo that was todone --- agent/xds/listeners.go | 1 - 1 file changed, 1 deletion(-) diff --git a/agent/xds/listeners.go b/agent/xds/listeners.go index 08cc81f84..b61c8daaf 100644 --- a/agent/xds/listeners.go +++ b/agent/xds/listeners.go @@ -76,7 +76,6 @@ func (s *Server) listenersFromSnapshotConnectProxy(cInfo connectionInfo, cfgSnap port = cfgSnap.Proxy.TransparentProxy.OutboundListenerPort } - // TODO (freddy) Make DefaultTProxyOutboundPort configurable outboundListener = makeListener(OutboundListenerName, "127.0.0.1", port, envoy_core_v3.TrafficDirection_OUTBOUND) outboundListener.FilterChains = make([]*envoy_listener_v3.FilterChain, 0) outboundListener.ListenerFilters = []*envoy_listener_v3.ListenerFilter{