cli: deprecate -vault-token flag (#18881)

Apply the same deprecation notice from #18863 to the `nomad job plan`
command.
This commit is contained in:
Luiz Aoqui
2023-10-27 12:48:11 -04:00
committed by GitHub
parent 2daf49df9a
commit 71a471b90a

View File

@@ -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)