cmd/tailscale/cli: remove Services-specific subcommands from funnel

The funnel command is sort of an alias for the serve command. This means
that the subcommands added to serve to support Services appear as
subcommands for funnel as well, despite having no meaning for funnel.
This change removes all such Services-specific subcommands from funnel.

Fixes tailscale/corp#34167
Signed-off-by: Harry Harpham <harry@tailscale.com>
This commit is contained in:
Harry Harpham 2025-12-16 15:49:51 -07:00
parent 0fd1670a59
commit b1b94f715f
No known key found for this signature in database

View File

@ -243,15 +243,16 @@ func newServeV2Command(e *serveEnv, subcmd serveMode) *ffcli.Command {
fs.UintVar(&e.http, "http", 0, "Expose an HTTP server at the specified port")
fs.Var(&acceptAppCapsFlag{Value: &e.acceptAppCaps}, "accept-app-caps", "App capabilities to forward to the server (specify multiple capabilities with a comma-separated list)")
fs.Var(&serviceNameFlag{Value: &e.service}, "service", "Serve for a service with distinct virtual IP instead on node itself.")
fs.BoolVar(&e.tun, "tun", false, "Forward all traffic to the local machine (default false), only supported for services. Refer to docs for more information.")
}
fs.UintVar(&e.tcp, "tcp", 0, "Expose a TCP forwarder to forward raw TCP packets at the specified port")
fs.UintVar(&e.tlsTerminatedTCP, "tls-terminated-tcp", 0, "Expose a TCP forwarder to forward TLS-terminated TCP packets at the specified port")
fs.UintVar(&e.proxyProtocol, "proxy-protocol", 0, "PROXY protocol version (1 or 2) for TCP forwarding")
fs.BoolVar(&e.yes, "yes", false, "Update without interactive prompts (default false)")
fs.BoolVar(&e.tun, "tun", false, "Forward all traffic to the local machine (default false), only supported for services. Refer to docs for more information.")
}),
UsageFunc: usageFuncNoDefaultValues,
Subcommands: []*ffcli.Command{
Subcommands: func() []*ffcli.Command {
subcmds := []*ffcli.Command{
{
Name: "status",
ShortUsage: "tailscale " + info.Name + " status [--json]",
@ -268,6 +269,11 @@ func newServeV2Command(e *serveEnv, subcmd serveMode) *ffcli.Command {
Exec: e.runServeReset,
FlagSet: e.newFlags("serve-reset", nil),
},
}
if subcmd == funnel {
return subcmds
}
return append(subcmds, []*ffcli.Command{
{
Name: "drain",
ShortUsage: fmt.Sprintf("tailscale %s drain <service>", info.Name),
@ -323,7 +329,8 @@ func newServeV2Command(e *serveEnv, subcmd serveMode) *ffcli.Command {
fs.Var(&serviceNameFlag{Value: &e.service}, "service", "apply config to a particular service")
}),
},
},
}...)
}(),
}
}