Skip to content

Commit

Permalink
cli: deprecate -vault-token flag
Browse files Browse the repository at this point in the history
Apply the same deprecation notice from #18863 to the `nomad job plan`
command.
  • Loading branch information
lgfa29 committed Oct 26, 2023
1 parent 23665a5 commit 8921b9f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions command/job_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,13 @@ func (c *JobPlanCommand) Run(args []string) int {
vaultToken = os.Getenv("VAULT_TOKEN")
}

if vaultToken != "" {
c.Ui.Warn(strings.TrimSpace(`
Warning: setting a Vault token when submitting a job is deprecated and will be
removed in Nomad 1.9. Migrate your Vault configuration to use workload identity.`))
job.VaultToken = pointer.Of(vaultToken)
}

// Set the vault token.
if vaultToken != "" {
job.VaultToken = pointer.Of(vaultToken)
Expand Down

0 comments on commit 8921b9f

Please sign in to comment.