diff --git a/tailnet/coordinator.go b/tailnet/coordinator.go index 1373b370a5def..cd5e0e41d6def 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, "") - missingAgents := map[uuid.UUID]map[uuid.UUID]*trackedConn{} - for agentID, conns := range c.agentToConnectionSockets { - if len(conns) == 0 { - continue + { + fmt.Fprintf(w, "

# agents: total %d

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

# missing agents: total %d

\n", len(missingAgents)) - fmt.Fprintln(w, "") }