tailscale/cmd/tailscale/cli/debug-cachenetmap.go
M. J. Fromberger eaa5d9df4b
client,cmd/tailscale,ipn/{ipnlocal,localapi}: add debug CLI command to clear netmap caches (#19213)
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>
2026-04-02 12:06:39 -07:00

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")
}