From 9f0696528bdc1acf0b46bc9b1282582ce3c1e6c8 Mon Sep 17 00:00:00 2001 From: freddygv Date: Wed, 17 Mar 2021 16:42:29 -0600 Subject: [PATCH] Rename hasChains for clarity --- agent/xds/listeners.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/agent/xds/listeners.go b/agent/xds/listeners.go index a32b6afe10..6efb7787a4 100644 --- a/agent/xds/listeners.go +++ b/agent/xds/listeners.go @@ -85,7 +85,7 @@ func (s *Server) listenersFromSnapshotConnectProxy(cInfo connectionInfo, cfgSnap } } - var hasChains bool + var hasFilterChains bool for id, chain := range cfgSnap.ConnectProxy.DiscoveryChain { upstreamCfg := cfgSnap.ConnectProxy.UpstreamConfig[id] @@ -212,11 +212,11 @@ func (s *Server) listenersFromSnapshotConnectProxy(cInfo connectionInfo, cfgSnap if len(ranges) > 0 { outboundListener.FilterChains = append(outboundListener.FilterChains, filterChain) } - hasChains = true + hasFilterChains = true } // Only create the outbound listener when there are upstreams and filter chains are present - if outboundListener != nil && hasChains { + if outboundListener != nil && hasFilterChains { // Filter chains are stable sorted to avoid draining if the list is provided out of order sort.SliceStable(outboundListener.FilterChains, func(i, j int) bool { return outboundListener.FilterChains[i].Name < outboundListener.FilterChains[j].Name