Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: add help message for -consul-namespace #18081

Merged
merged 2 commits into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -121,6 +121,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 @@ -156,21 +164,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
Loading