mirror of
https://github.com/tailscale/tailscale.git
synced 2025-03-31 21:42:24 +00:00
cmd/tailscale/cli: fix macOS crash reading envknob in init (#11667)
And add a test. Regression from a5e1f7d70364b3 Fixes tailscale/corp#19036 Change-Id: If90984049af0a4820c96e1f77ddf2fce8cb3043f Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
0f3a292ebd
commit
e6983baa73
@ -131,7 +131,7 @@ change in the future.
|
|||||||
certCmd,
|
certCmd,
|
||||||
netlockCmd,
|
netlockCmd,
|
||||||
licensesCmd,
|
licensesCmd,
|
||||||
exitNodeCmd,
|
exitNodeCmd(),
|
||||||
updateCmd,
|
updateCmd,
|
||||||
whoisCmd,
|
whoisCmd,
|
||||||
},
|
},
|
||||||
|
@ -16,6 +16,7 @@ import (
|
|||||||
|
|
||||||
qt "github.com/frankban/quicktest"
|
qt "github.com/frankban/quicktest"
|
||||||
"github.com/google/go-cmp/cmp"
|
"github.com/google/go-cmp/cmp"
|
||||||
|
"tailscale.com/envknob"
|
||||||
"tailscale.com/health/healthmsg"
|
"tailscale.com/health/healthmsg"
|
||||||
"tailscale.com/ipn"
|
"tailscale.com/ipn"
|
||||||
"tailscale.com/ipn/ipnstate"
|
"tailscale.com/ipn/ipnstate"
|
||||||
@ -33,6 +34,10 @@ import (
|
|||||||
// and at least one thing that's not (darwin, freebsd).
|
// and at least one thing that's not (darwin, freebsd).
|
||||||
var geese = []string{"linux", "darwin", "windows", "freebsd"}
|
var geese = []string{"linux", "darwin", "windows", "freebsd"}
|
||||||
|
|
||||||
|
func TestPanicIfAnyEnvCheckedInInit(t *testing.T) {
|
||||||
|
envknob.PanicIfAnyEnvCheckedInInit()
|
||||||
|
}
|
||||||
|
|
||||||
// Test that checkForAccidentalSettingReverts's updateMaskedPrefsFromUpFlag can handle
|
// Test that checkForAccidentalSettingReverts's updateMaskedPrefsFromUpFlag can handle
|
||||||
// all flags. This will panic if a new flag creeps in that's unhandled.
|
// all flags. This will panic if a new flag creeps in that's unhandled.
|
||||||
//
|
//
|
||||||
|
@ -20,7 +20,8 @@ import (
|
|||||||
"tailscale.com/tailcfg"
|
"tailscale.com/tailcfg"
|
||||||
)
|
)
|
||||||
|
|
||||||
var exitNodeCmd = &ffcli.Command{
|
func exitNodeCmd() *ffcli.Command {
|
||||||
|
return &ffcli.Command{
|
||||||
Name: "exit-node",
|
Name: "exit-node",
|
||||||
ShortUsage: "exit-node [flags]",
|
ShortUsage: "exit-node [flags]",
|
||||||
ShortHelp: "Show machines on your tailnet configured as exit nodes",
|
ShortHelp: "Show machines on your tailnet configured as exit nodes",
|
||||||
@ -60,6 +61,7 @@ var exitNodeCmd = &ffcli.Command{
|
|||||||
}
|
}
|
||||||
})()...),
|
})()...),
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var exitNodeArgs struct {
|
var exitNodeArgs struct {
|
||||||
filter string
|
filter string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user