Rename command to ready

This commit is contained in:
Mads Jon Nielsen 2024-04-23 08:35:25 +02:00
parent 37210ff661
commit b342c7403c
2 changed files with 5 additions and 5 deletions

View File

@ -131,7 +131,7 @@ func Commands() []*cli.Command {
buildVirtualNetworkSubcommand(false), buildVirtualNetworkSubcommand(false),
buildRunCommand(), buildRunCommand(),
buildListCommand(), buildListCommand(),
buildHealthCommand(), buildReadyCommand(),
buildInfoCommand(), buildInfoCommand(),
buildIngressSubcommand(), buildIngressSubcommand(),
buildDeleteCommand(), buildDeleteCommand(),

View File

@ -398,10 +398,10 @@ func fmtConnections(connections []cfapi.Connection, showRecentlyDisconnected boo
return strings.Join(output, ", ") return strings.Join(output, ", ")
} }
func buildHealthCommand() *cli.Command { func buildReadyCommand() *cli.Command {
return &cli.Command{ return &cli.Command{
Name: "health", Name: "health",
Action: cliutil.ConfiguredAction(healthCommand), Action: cliutil.ConfiguredAction(readyCommand),
Usage: "Tunnel health exit code", Usage: "Tunnel health exit code",
UsageText: "cloudflared tunnel [tunnel command options] health [subcommand options]", UsageText: "cloudflared tunnel [tunnel command options] health [subcommand options]",
Description: "cloudflared tunnel health will return proper exit code if tunnel is healthy or unhealthy", Description: "cloudflared tunnel health will return proper exit code if tunnel is healthy or unhealthy",
@ -410,8 +410,8 @@ func buildHealthCommand() *cli.Command {
} }
} }
func healthCommand(c *cli.Context) error { func readyCommand(c *cli.Context) error {
requestURL := fmt.Sprintf("http://%s/healthcheck", c.String("metrics")) requestURL := fmt.Sprintf("http://%s/ready", c.String("metrics"))
res, err := http.Get(requestURL) res, err := http.Get(requestURL)
if err != nil { if err != nil {
return err return err