mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-19 13:11:41 +00:00
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 <danderson@tailscale.com>
This commit is contained in:
parent
39748e9562
commit
daf54d1253
@ -788,28 +788,6 @@ func (c *Direct) sendMapRequest(ctx context.Context, maxPolls int, cb func(*netm
|
|||||||
return errors.New("MapResponse lacked node")
|
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 {
|
if Debug.StripEndpoints {
|
||||||
for _, p := range resp.Peers {
|
for _, p := range resp.Peers {
|
||||||
// We need at least one endpoint here for now else
|
// We need at least one endpoint here for now else
|
||||||
@ -991,21 +969,18 @@ var Debug = initDebug()
|
|||||||
type debug struct {
|
type debug struct {
|
||||||
NetMap bool
|
NetMap bool
|
||||||
ProxyDNS bool
|
ProxyDNS bool
|
||||||
OnlyDisco bool
|
|
||||||
Disco bool
|
Disco bool
|
||||||
StripEndpoints bool // strip endpoints from control (only use disco messages)
|
StripEndpoints bool // strip endpoints from control (only use disco messages)
|
||||||
StripCaps bool // strip all local node's control-provided capabilities
|
StripCaps bool // strip all local node's control-provided capabilities
|
||||||
}
|
}
|
||||||
|
|
||||||
func initDebug() debug {
|
func initDebug() debug {
|
||||||
use := os.Getenv("TS_DEBUG_USE_DISCO")
|
|
||||||
return debug{
|
return debug{
|
||||||
NetMap: envBool("TS_DEBUG_NETMAP"),
|
NetMap: envBool("TS_DEBUG_NETMAP"),
|
||||||
ProxyDNS: envBool("TS_DEBUG_PROXY_DNS"),
|
ProxyDNS: envBool("TS_DEBUG_PROXY_DNS"),
|
||||||
StripEndpoints: envBool("TS_DEBUG_STRIP_ENDPOINTS"),
|
StripEndpoints: envBool("TS_DEBUG_STRIP_ENDPOINTS"),
|
||||||
StripCaps: envBool("TS_DEBUG_STRIP_CAPS"),
|
StripCaps: envBool("TS_DEBUG_STRIP_CAPS"),
|
||||||
OnlyDisco: use == "only",
|
Disco: os.Getenv("TS_DEBUG_USE_DISCO") == "" || envBool("TS_DEBUG_USE_DISCO"),
|
||||||
Disco: use == "only" || use == "" || envBool("TS_DEBUG_USE_DISCO"),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,7 +11,6 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"inet.af/netaddr"
|
"inet.af/netaddr"
|
||||||
"tailscale.com/control/controlclient"
|
|
||||||
"tailscale.com/net/tsaddr"
|
"tailscale.com/net/tsaddr"
|
||||||
"tailscale.com/tailcfg"
|
"tailscale.com/tailcfg"
|
||||||
"tailscale.com/types/logger"
|
"tailscale.com/types/logger"
|
||||||
@ -66,9 +65,6 @@ func WGCfg(nm *netmap.NetworkMap, logf logger.Logf, flags netmap.WGConfigFlags,
|
|||||||
skippedSubnets := new(bytes.Buffer)
|
skippedSubnets := new(bytes.Buffer)
|
||||||
|
|
||||||
for _, peer := range nm.Peers {
|
for _, peer := range nm.Peers {
|
||||||
if controlclient.Debug.OnlyDisco && peer.DiscoKey.IsZero() {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if peer.DiscoKey.IsZero() && peer.DERP == "" {
|
if peer.DiscoKey.IsZero() && peer.DERP == "" {
|
||||||
// Peer predates both DERP and active discovery, we cannot
|
// Peer predates both DERP and active discovery, we cannot
|
||||||
// communicate with it.
|
// communicate with it.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user