From c39f0ae317c709dfcb2cc039399da5b525d4f35e Mon Sep 17 00:00:00 2001 From: Mads Jon Nielsen Date: Thu, 14 Nov 2024 18:38:17 +0100 Subject: [PATCH] Make metrics a requirement for tunnel ready command --- cmd/cloudflared/tunnel/subcommands.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/cloudflared/tunnel/subcommands.go b/cmd/cloudflared/tunnel/subcommands.go index 20604290..dbe9e80a 100644 --- a/cmd/cloudflared/tunnel/subcommands.go +++ b/cmd/cloudflared/tunnel/subcommands.go @@ -413,6 +413,10 @@ func buildReadyCommand() *cli.Command { func readyCommand(c *cli.Context) error { metricsOpts := c.String("metrics") + if !c.IsSet("metrics") { + return fmt.Errorf("--metrics has to be provided") + } + requestURL := fmt.Sprintf("http://%s/ready", metricsOpts) res, err := http.Get(requestURL) if err != nil {