mirror of
https://github.com/tailscale/tailscale.git
synced 2026-05-06 20:56:24 +02:00
This is a follow-up to #19117, adding a debug CLI command allowing the operator to explicitly discard cached netmap data, as a safety and recovery measure. Updates #12639 Change-Id: I5c3c47c0204754b9c8e526a4ff8f69d6974db6d0 Signed-off-by: M. J. Fromberger <fromberger@tailscale.com>
32 lines
716 B
Go
32 lines
716 B
Go
// Copyright (c) Tailscale Inc & contributors
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
//go:build !ios && !ts_omit_cachenetmap
|
|
|
|
package cli
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
|
|
"github.com/peterbourgon/ff/v3/ffcli"
|
|
)
|
|
|
|
func init() {
|
|
debugClearNetmapCacheCmd = func() *ffcli.Command {
|
|
return &ffcli.Command{
|
|
Name: "clear-netmap-cache",
|
|
ShortUsage: "tailscale debug clear-netmap-cache",
|
|
ShortHelp: "Remove and discard cached network maps (if any)",
|
|
Exec: runDebugClearNetmapCache,
|
|
}
|
|
}
|
|
}
|
|
|
|
func runDebugClearNetmapCache(ctx context.Context, args []string) error {
|
|
if len(args) != 0 {
|
|
return errors.New("unexpected arguments")
|
|
}
|
|
return localClient.DebugAction(ctx, "clear-netmap-cache")
|
|
}
|