diff --git a/.changelog/13405.txt b/.changelog/13405.txt new file mode 100644 index 000000000..fac6e67f2 --- /dev/null +++ b/.changelog/13405.txt @@ -0,0 +1,3 @@ +```release-note:bug +cli: Fixed remaining bugs where the evaluation ID was not printed when the `-detach` flag was passed +`` diff --git a/command/deployment_fail.go b/command/deployment_fail.go index 625f90e85..3e0557a4d 100644 --- a/command/deployment_fail.go +++ b/command/deployment_fail.go @@ -132,7 +132,12 @@ func (c *DeploymentFailCommand) Run(args []string) int { evalCreated := u.EvalID != "" // Nothing to do - if detach || !evalCreated { + if !evalCreated { + return 0 + } + + if detach { + c.Ui.Output("Evaluation ID: " + u.EvalID) return 0 } diff --git a/command/deployment_promote.go b/command/deployment_promote.go index 1450644d6..9e44c29d3 100644 --- a/command/deployment_promote.go +++ b/command/deployment_promote.go @@ -140,9 +140,15 @@ func (c *DeploymentPromoteCommand) Run(args []string) int { return 1 } - // Nothing to do evalCreated := u.EvalID != "" - if detach || !evalCreated { + + // Nothing to do + if !evalCreated { + return 0 + } + + if detach { + c.Ui.Output("Evaluation ID: " + u.EvalID) return 0 } diff --git a/command/deployment_resume.go b/command/deployment_resume.go index f3d4a31b1..156dfcafa 100644 --- a/command/deployment_resume.go +++ b/command/deployment_resume.go @@ -124,7 +124,12 @@ func (c *DeploymentResumeCommand) Run(args []string) int { evalCreated := u.EvalID != "" // Nothing to do - if detach || !evalCreated { + if !evalCreated { + return 0 + } + + if detach { + c.Ui.Output("Evaluation ID: " + u.EvalID) return 0 } diff --git a/command/deployment_unblock.go b/command/deployment_unblock.go index ede63fe29..23b6e138f 100644 --- a/command/deployment_unblock.go +++ b/command/deployment_unblock.go @@ -124,7 +124,12 @@ func (c *DeploymentUnblockCommand) Run(args []string) int { evalCreated := u.EvalID != "" // Nothing to do - if detach || !evalCreated { + if !evalCreated { + return 0 + } + + if detach { + c.Ui.Output("Evaluation ID: " + u.EvalID) return 0 } diff --git a/command/job_promote.go b/command/job_promote.go index 9ec99eb9a..5d308b17d 100644 --- a/command/job_promote.go +++ b/command/job_promote.go @@ -161,9 +161,15 @@ func (c *JobPromoteCommand) Run(args []string) int { return 1 } - // Nothing to do evalCreated := u.EvalID != "" - if detach || !evalCreated { + + // Nothing to do + if !evalCreated { + return 0 + } + + if detach { + c.Ui.Output("Evaluation ID: " + u.EvalID) return 0 }