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
This commit is contained in:
James Phillips 2017-10-19 18:59:05 -07:00
parent bb23d44469
commit 60af465b4e
No known key found for this signature in database
GPG Key ID: 77183E682AC5FC11
2 changed files with 19 additions and 16 deletions

View File

@ -67,11 +67,15 @@ const synopsis = "Validate config files/directories"
const help = ` const help = `
Usage: consul validate [options] FILE_OR_DIRECTORY... Usage: consul validate [options] FILE_OR_DIRECTORY...
Performs a basic sanity test on Consul configuration files. For each file Performs a thorough sanity test on Consul configuration files. For each file
or directory given, the validate command will attempt to parse the or directory given, the validate command will attempt to parse the contents
contents just as the "consul agent" command would, and catch any errors. just as the "consul agent" command would, and catch any errors.
This is useful to do a test of the configuration only, without actually 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. Returns 0 if the configuration is valid, or 1 if there are problems.
` `

View File

@ -10,26 +10,25 @@ description: >
# Consul Validate # Consul Validate
The `consul validate` command performs a basic sanity test on Consul The `consul validate` command performs a thorough sanity test on Consul
configuration files. For each file or directory given, the validate command configuration files. For each file or directory given, the command will
will attempt to parse the contents just as the "consul agent" command would, 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, and catch any errors.
without actually starting the agent.
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 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. section.
## Usage ## Usage
Usage: `consul validate [options] FILE_OR_DIRECTORY...` 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. Returns 0 if the configuration is valid, or 1 if there are problems.
```text ```text