From 8921b9f389ab455f4acce4653ba02ec3c5c96f9b Mon Sep 17 00:00:00 2001 From: Luiz Aoqui Date: Thu, 26 Oct 2023 18:16:31 -0400 Subject: [PATCH] cli: deprecate -vault-token flag Apply the same deprecation notice from #18863 to the `nomad job plan` command. --- command/job_plan.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/command/job_plan.go b/command/job_plan.go index 1fa3789730b..e6de9555288 100644 --- a/command/job_plan.go +++ b/command/job_plan.go @@ -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)