mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 21:27:31 +00:00
net/portmapper: add envknob to disable portmapper in localhost integration tests
Updates #11962 Change-Id: I8212cd814985b455d96986de0d4c45f119516cb3 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
7e0dd61e61
commit
ce8969d82b
@@ -21,6 +21,7 @@ import (
|
||||
|
||||
"go4.org/mem"
|
||||
"tailscale.com/control/controlknobs"
|
||||
"tailscale.com/envknob"
|
||||
"tailscale.com/net/netaddr"
|
||||
"tailscale.com/net/neterror"
|
||||
"tailscale.com/net/netmon"
|
||||
@@ -32,6 +33,8 @@ import (
|
||||
"tailscale.com/util/clientmetric"
|
||||
)
|
||||
|
||||
var disablePortMapperEnv = envknob.RegisterBool("TS_DISABLE_PORTMAPPER")
|
||||
|
||||
// DebugKnobs contains debug configuration that can be provided when creating a
|
||||
// Client. The zero value is valid for use.
|
||||
type DebugKnobs struct {
|
||||
@@ -55,6 +58,9 @@ type DebugKnobs struct {
|
||||
}
|
||||
|
||||
func (k *DebugKnobs) disableAll() bool {
|
||||
if disablePortMapperEnv() {
|
||||
return true
|
||||
}
|
||||
if k.DisableAll != nil {
|
||||
return k.DisableAll()
|
||||
}
|
||||
|
Reference in New Issue
Block a user