From ecee15b4668e33762d36850b74e4d462bb39b917 Mon Sep 17 00:00:00 2001 From: James Phillips Date: Thu, 19 Oct 2017 18:59:05 -0700 Subject: [PATCH] Updates documentation for consul validate. This makes it clear that you need to pass the full configuration, and that the command won't work with config fragments. Closes #3591 --- command/validate/validate.go | 12 ++++++---- website/source/docs/commands/validate.html.md | 23 +++++++++---------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/command/validate/validate.go b/command/validate/validate.go index 2ea4d33622..1b3923239c 100644 --- a/command/validate/validate.go +++ b/command/validate/validate.go @@ -67,11 +67,15 @@ const synopsis = "Validate config files/directories" const help = ` Usage: consul validate [options] FILE_OR_DIRECTORY... - Performs a basic sanity test on Consul configuration files. For each file - or directory given, the validate command will attempt to parse the - contents just as the "consul agent" command would, and catch any errors. + Performs a thorough sanity test on Consul configuration files. For each file + or directory given, the validate command will attempt to parse the contents + just as the "consul agent" command would, and catch any errors. + This is useful to do a test of the configuration only, without actually - starting the agent. + starting the agent. This performs all of the validation the agent would, so + this should be given the complete set of configuration files that are going + to be loaded by the agent. This command cannot operate on partial + configuration fragments since those won't pass the full agent validation. Returns 0 if the configuration is valid, or 1 if there are problems. ` diff --git a/website/source/docs/commands/validate.html.md b/website/source/docs/commands/validate.html.md index d71339b673..d1970fb415 100644 --- a/website/source/docs/commands/validate.html.md +++ b/website/source/docs/commands/validate.html.md @@ -10,26 +10,25 @@ description: > # Consul Validate -The `consul validate` command performs a basic sanity test on Consul -configuration files. For each file or directory given, the validate command -will attempt to parse the contents just as the "consul agent" command would, -and catch any errors. This is useful to do a test of the configuration only, -without actually starting the agent. +The `consul validate` command performs a thorough sanity test on Consul +configuration files. For each file or directory given, the command will +attempt to parse the contents just as the `consul agent` command would, +and catch any errors. + +This is useful to do a test of the configuration only, without actually +starting the agent. This performs all of the validation the agent would, so +this should be given the complete set of configuration files that are going +to be loaded by the agent. This command cannot operate on partial +configuration fragments since those won't pass the full agent validation. For more information on the format of Consul's configuration files, read the -consul agent [Configuration Files](/docs/agent/options.html#configuration_files) +consul agent [Configuration Files](/docs/agent/options.html#configuration-files) section. ## Usage Usage: `consul validate [options] FILE_OR_DIRECTORY...` -Performs a basic sanity test on Consul configuration files. For each file -or directory given, the validate command will attempt to parse the -contents just as the "consul agent" command would, and catch any errors. -This is useful to do a test of the configuration only, without actually -starting the agent. - Returns 0 if the configuration is valid, or 1 if there are problems. ```text