Skip to content

Commit

Permalink
cli: add help message for -consul-namespace (#18081)
Browse files Browse the repository at this point in the history
Add missing help entry for the `-consul-namespace` flag in `nomad job
run`.
  • Loading branch information
lgfa29 committed Jul 28, 2023
1 parent 20cd60d commit 083faa1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 17 deletions.
3 changes: 3 additions & 0 deletions .changelog/18081.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
cli: Add missing help message for the `-consul-namespace` flag in the `nomad job run` command
```
39 changes: 24 additions & 15 deletions command/job_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,14 @@ Run Options:
the job file. This overrides the token found in $CONSUL_HTTP_TOKEN environment
variable and that found in the job.
-consul-namespace
(Enterprise only) If set, any services in the job will be registered into
the specified Consul namespace. Any template block reading from Consul KV
will be scoped to the specified Consul namespace. If Consul ACLs are
enabled and the "consul" block "allow_unauthenticated" is disabled in the
Nomad server configuration, then a Consul token must be supplied with
appropriate service and KV Consul ACL policy permissions.
-vault-token
Used to validate if the user submitting the job has permission to run the job
according to its Vault policies. A Vault token must be supplied if the vault
Expand Down Expand Up @@ -153,21 +161,22 @@ func (c *JobRunCommand) Synopsis() string {
func (c *JobRunCommand) AutocompleteFlags() complete.Flags {
return mergeAutocompleteFlags(c.Meta.AutocompleteFlags(FlagSetClient),
complete.Flags{
"-check-index": complete.PredictNothing,
"-detach": complete.PredictNothing,
"-verbose": complete.PredictNothing,
"-consul-token": complete.PredictNothing,
"-vault-token": complete.PredictAnything,
"-vault-namespace": complete.PredictAnything,
"-output": complete.PredictNothing,
"-policy-override": complete.PredictNothing,
"-preserve-counts": complete.PredictNothing,
"-json": complete.PredictNothing,
"-hcl1": complete.PredictNothing,
"-hcl2-strict": complete.PredictNothing,
"-var": complete.PredictAnything,
"-var-file": complete.PredictFiles("*.var"),
"-eval-priority": complete.PredictNothing,
"-check-index": complete.PredictNothing,
"-detach": complete.PredictNothing,
"-verbose": complete.PredictNothing,
"-consul-token": complete.PredictNothing,
"-consul-namespace": complete.PredictAnything,
"-vault-token": complete.PredictAnything,
"-vault-namespace": complete.PredictAnything,
"-output": complete.PredictNothing,
"-policy-override": complete.PredictNothing,
"-preserve-counts": complete.PredictNothing,
"-json": complete.PredictNothing,
"-hcl1": complete.PredictNothing,
"-hcl2-strict": complete.PredictNothing,
"-var": complete.PredictAnything,
"-var-file": complete.PredictFiles("*.var"),
"-eval-priority": complete.PredictNothing,
})
}

Expand Down
4 changes: 2 additions & 2 deletions website/content/docs/commands/job/run.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ that volume.

- `-consul-namespace`: <EnterpriseAlert inline/> If set, any services in the job will be registered into the
specified Consul namespace. Any `template` block reading from Consul KV will
scoped to the specified Consul namespace. If Consul ACLs are enabled and the
be scoped to the specified Consul namespace. If Consul ACLs are enabled and the
[`consul` block `allow_unauthenticated`] is disabled in the Nomad server configuration, then
a Consul token must be supplied with appropriate service and kv Consul ACL policy
a Consul token must be supplied with appropriate service and KV Consul ACL policy
permissions.

- `-vault-token`: Used to validate if the user submitting the job has
Expand Down

0 comments on commit 083faa1

Please sign in to comment.