From 75edc9bc7c42d94a1b25f3213fc125664d55aa76 Mon Sep 17 00:00:00 2001 From: freddygv Date: Tue, 13 Apr 2021 10:17:11 -0600 Subject: [PATCH] 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{