envknob: add GOOS func

Centralize the fake GOOS stuff, start to use it more. To be used more
in the future.

Change-Id: Iabacfbeaf5fca0b53bf4d5dbcdc0367f05a205f9
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2022-11-23 15:40:47 -08:00
committed by Brad Fitzpatrick
parent 6e6f27dd21
commit 4d3713f631
6 changed files with 45 additions and 10 deletions

View File

@@ -274,12 +274,7 @@ func statePathOrDefault() string {
}
func ipnServerOpts() (o ipnserver.Options) {
// Allow changing the OS-specific IPN behavior for tests
// so we can e.g. test Windows-specific behaviors on Linux.
goos := envknob.String("TS_DEBUG_TAILSCALED_IPN_GOOS")
if goos == "" {
goos = runtime.GOOS
}
goos := envknob.GOOS()
o.VarRoot = args.statedir