From 64d38366455a2a7bebe344571f66504fd14522e7 Mon Sep 17 00:00:00 2001 From: Adam Chalmers Date: Mon, 9 Nov 2020 11:15:10 -0600 Subject: [PATCH] TUN-3522: ingress validate checks that the config file exists --- cmd/cloudflared/tunnel/ingress_subcommands.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/cloudflared/tunnel/ingress_subcommands.go b/cmd/cloudflared/tunnel/ingress_subcommands.go index de3b1350..0a818812 100644 --- a/cmd/cloudflared/tunnel/ingress_subcommands.go +++ b/cmd/cloudflared/tunnel/ingress_subcommands.go @@ -70,6 +70,10 @@ func buildTestURLCommand() *cli.Command { // validateIngressCommand check the syntax of the ingress rules in the cloudflared config file func validateIngressCommand(c *cli.Context) error { conf := config.GetConfiguration() + if conf.Source() == "" { + fmt.Println("No configuration file was found. Please create one, or use the --config flag to specify its filepath. You can use the help command to learn more about configuration files") + return nil + } fmt.Println("Validating rules from", conf.Source()) if _, err := ingress.ParseIngress(conf); err != nil { return errors.Wrap(err, "Validation failed")