cmd/tailscale/cli: remove Services-specific subcommands from funnel (#18225)
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:
@@ -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.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(&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.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.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.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.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.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,
|
UsageFunc: usageFuncNoDefaultValues,
|
||||||
Subcommands: []*ffcli.Command{
|
Subcommands: func() []*ffcli.Command {
|
||||||
|
subcmds := []*ffcli.Command{
|
||||||
{
|
{
|
||||||
Name: "status",
|
Name: "status",
|
||||||
ShortUsage: "tailscale " + info.Name + " status [--json]",
|
ShortUsage: "tailscale " + info.Name + " status [--json]",
|
||||||
@@ -268,6 +269,9 @@ func newServeV2Command(e *serveEnv, subcmd serveMode) *ffcli.Command {
|
|||||||
Exec: e.runServeReset,
|
Exec: e.runServeReset,
|
||||||
FlagSet: e.newFlags("serve-reset", nil),
|
FlagSet: e.newFlags("serve-reset", nil),
|
||||||
},
|
},
|
||||||
|
}
|
||||||
|
if subcmd == serve {
|
||||||
|
subcmds = append(subcmds, []*ffcli.Command{
|
||||||
{
|
{
|
||||||
Name: "drain",
|
Name: "drain",
|
||||||
ShortUsage: fmt.Sprintf("tailscale %s drain <service>", info.Name),
|
ShortUsage: fmt.Sprintf("tailscale %s drain <service>", info.Name),
|
||||||
@@ -323,7 +327,10 @@ func newServeV2Command(e *serveEnv, subcmd serveMode) *ffcli.Command {
|
|||||||
fs.Var(&serviceNameFlag{Value: &e.service}, "service", "apply config to a particular service")
|
fs.Var(&serviceNameFlag{Value: &e.service}, "service", "apply config to a particular service")
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
},
|
}...)
|
||||||
|
}
|
||||||
|
return subcmds
|
||||||
|
}(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user