From 233492b75da75d4df9eb54320b351e18a099a210 Mon Sep 17 00:00:00 2001 From: Colin Adler Date: Wed, 25 Jan 2023 18:29:51 -0600 Subject: [PATCH] fix: ensure coordinator debug output is always sorted (#5867) --- tailnet/coordinator.go | 148 +++++++++++++++++++++++++++-------------- 1 file changed, 98 insertions(+), 50 deletions(-) diff --git a/tailnet/coordinator.go b/tailnet/coordinator.go index 1373b370a5..cd5e0e41d6 100644 --- a/tailnet/coordinator.go +++ b/tailnet/coordinator.go @@ -14,6 +14,7 @@ import ( "time" "github.com/google/uuid" + "golang.org/x/exp/slices" "golang.org/x/xerrors" "tailscale.com/tailcfg" "tailscale.com/types/key" @@ -444,62 +445,109 @@ func (c *coordinator) ServeHTTPDebug(w http.ResponseWriter, _ *http.Request) { defer c.mutex.RUnlock() fmt.Fprintln(w, "

in-memory wireguard coordinator debug

") - fmt.Fprintf(w, "

# agents: total %d

\n", len(c.agentSockets)) - fmt.Fprintln(w, "