diff options
| author | Brad Fitzpatrick <bradfitz@tailscale.com> | 2023-01-23 14:55:36 -0800 |
|---|---|---|
| committer | Brad Fitzpatrick <brad@danga.com> | 2023-01-23 19:12:26 -0800 |
| commit | c8db70fd7363fd5cc3b4aa8288edbb56949afdbd (patch) | |
| tree | 216ab98ab616901affc48ecacaff7a24de3c18ba /cmd | |
| parent | 140b9aad5c7c2540f8284d3affab628e23cd95d4 (diff) | |
| download | tailscale-c8db70fd7363fd5cc3b4aa8288edbb56949afdbd.tar.xz tailscale-c8db70fd7363fd5cc3b4aa8288edbb56949afdbd.zip | |
cmd/tailscale/cli: add debug set-expire command for testing
Updates tailscale/corp#8811
Updates tailscale/corp#8613
Change-Id: I1c87806ca3ccc5c43e7ddbd6b4d521f73f7d29f1
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/tailscale/cli/debug.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/cmd/tailscale/cli/debug.go b/cmd/tailscale/cli/debug.go index 4e22a0688..f6e91b8f4 100644 --- a/cmd/tailscale/cli/debug.go +++ b/cmd/tailscale/cli/debug.go @@ -167,6 +167,16 @@ var debugCmd = &ffcli.Command{ })(), }, { + Name: "set-expire", + Exec: runSetExpire, + ShortHelp: "manipulate node key expiry for testing", + FlagSet: (func() *flag.FlagSet { + fs := newFlagSet("set-expire") + fs.DurationVar(&setExpireArgs.in, "in", 0, "if non-zero, set node key to expire this duration from now") + return fs + })(), + }, + { Name: "dev-store-set", Exec: runDevStoreSet, ShortHelp: "set a key/value pair during development", @@ -714,3 +724,14 @@ func runDebugDERP(ctx context.Context, args []string) error { fmt.Printf("%s\n", must.Get(json.MarshalIndent(st, "", " "))) return nil } + +var setExpireArgs struct { + in time.Duration +} + +func runSetExpire(ctx context.Context, args []string) error { + if len(args) != 0 || setExpireArgs.in == 0 { + return errors.New("usage --in=<duration>") + } + return localClient.DebugSetExpireIn(ctx, setExpireArgs.in) +} |
