From 75edc9bc7c42d94a1b25f3213fc125664d55aa76 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 db99104375..ff36277da5 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 4e509aa7680ccb9d51834352967fb2574f15b601 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 08cc81f84c..b61c8daaf7 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{