From daf54d1253c357db30f01b51f25c5dc5e727b929 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 1 Sep 2021 17:32:22 -0700 Subject: [PATCH] control/controlclient: remove TS_DEBUG_USE_DISCO=only. It was useful early in development when disco clients were the exception and tailscale logs were noisier than today, but now non-disco is the exception. Updates #2752 Signed-off-by: David Anderson --- control/controlclient/direct.go | 27 +-------------------------- wgengine/wgcfg/nmcfg/nmcfg.go | 4 ---- 2 files changed, 1 insertion(+), 30 deletions(-) diff --git a/control/controlclient/direct.go b/control/controlclient/direct.go index bc4749c8e..9eb7b3b65 100644 --- a/control/controlclient/direct.go +++ b/control/controlclient/direct.go @@ -788,28 +788,6 @@ func (c *Direct) sendMapRequest(ctx context.Context, maxPolls int, cb func(*netm return errors.New("MapResponse lacked node") } - // Temporarily (2020-06-29) support removing all but - // discovery-supporting nodes during development, for - // less noise. - if Debug.OnlyDisco { - anyOld, numDisco := false, 0 - for _, p := range nm.Peers { - if p.DiscoKey.IsZero() { - anyOld = true - } else { - numDisco++ - } - } - if anyOld { - filtered := make([]*tailcfg.Node, 0, numDisco) - for _, p := range nm.Peers { - if !p.DiscoKey.IsZero() { - filtered = append(filtered, p) - } - } - nm.Peers = filtered - } - } if Debug.StripEndpoints { for _, p := range resp.Peers { // We need at least one endpoint here for now else @@ -991,21 +969,18 @@ var Debug = initDebug() type debug struct { NetMap bool ProxyDNS bool - OnlyDisco bool Disco bool StripEndpoints bool // strip endpoints from control (only use disco messages) StripCaps bool // strip all local node's control-provided capabilities } func initDebug() debug { - use := os.Getenv("TS_DEBUG_USE_DISCO") return debug{ NetMap: envBool("TS_DEBUG_NETMAP"), ProxyDNS: envBool("TS_DEBUG_PROXY_DNS"), StripEndpoints: envBool("TS_DEBUG_STRIP_ENDPOINTS"), StripCaps: envBool("TS_DEBUG_STRIP_CAPS"), - OnlyDisco: use == "only", - Disco: use == "only" || use == "" || envBool("TS_DEBUG_USE_DISCO"), + Disco: os.Getenv("TS_DEBUG_USE_DISCO") == "" || envBool("TS_DEBUG_USE_DISCO"), } } diff --git a/wgengine/wgcfg/nmcfg/nmcfg.go b/wgengine/wgcfg/nmcfg/nmcfg.go index c498413e1..469fbd1c8 100644 --- a/wgengine/wgcfg/nmcfg/nmcfg.go +++ b/wgengine/wgcfg/nmcfg/nmcfg.go @@ -11,7 +11,6 @@ import ( "strings" "inet.af/netaddr" - "tailscale.com/control/controlclient" "tailscale.com/net/tsaddr" "tailscale.com/tailcfg" "tailscale.com/types/logger" @@ -66,9 +65,6 @@ func WGCfg(nm *netmap.NetworkMap, logf logger.Logf, flags netmap.WGConfigFlags, skippedSubnets := new(bytes.Buffer) for _, peer := range nm.Peers { - if controlclient.Debug.OnlyDisco && peer.DiscoKey.IsZero() { - continue - } if peer.DiscoKey.IsZero() && peer.DERP == "" { // Peer predates both DERP and active discovery, we cannot // communicate with it.