From 06538a552010335446aaf6f75ba633cf98697193 Mon Sep 17 00:00:00 2001 From: Jamie Scheinblum Date: Thu, 21 Mar 2024 22:28:09 -0700 Subject: [PATCH] Account for infinite --- go/vt/vtgateproxy/discovery.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/go/vt/vtgateproxy/discovery.go b/go/vt/vtgateproxy/discovery.go index 003f1f9feb7..99bbc255d2d 100644 --- a/go/vt/vtgateproxy/discovery.go +++ b/go/vt/vtgateproxy/discovery.go @@ -161,6 +161,8 @@ func (r *JSONGateConfigResolver) loadConfig() (*[]resolver.Address, []byte, erro // Nothing in the filtered list? Get them all if len(filteredAddrs) == 0 { addrs = allAddrs + } else if *numConnectionsInt == 0 { + addrs = allAddrs } else if len(filteredAddrs) > *numConnectionsInt { addrs = filteredAddrs[0:*numConnectionsInt] } else if len(allAddrs) > *numConnectionsInt {