From da9f22f7ce89f004cb9b674091c765756c18d18e Mon Sep 17 00:00:00 2001 From: Joseph Martin Date: Wed, 15 Jun 2022 12:20:29 -0600 Subject: [PATCH] Return evalID if `-detach` flag is passed to job revert (#13364) * Return evalID if `-detach` flag is passed to job revert --- .changelog/13364.txt | 3 +++ command/job_revert.go | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .changelog/13364.txt diff --git a/.changelog/13364.txt b/.changelog/13364.txt new file mode 100644 index 000000000..7a34eda8f --- /dev/null +++ b/.changelog/13364.txt @@ -0,0 +1,3 @@ +```release-note:bug +cli: Fixed a bug where the evaluation ID was not returned from `job revert` when the `-detach` flag was used +`` \ No newline at end of file diff --git a/command/job_revert.go b/command/job_revert.go index 99d7bdd90..6ffde4736 100644 --- a/command/job_revert.go +++ b/command/job_revert.go @@ -164,7 +164,13 @@ func (c *JobRevertCommand) Run(args []string) int { // Nothing to do evalCreated := resp.EvalID != "" - if detach || !evalCreated { + + if !evalCreated { + return 0 + } + + if detach { + c.Ui.Output("Evaluation ID: " + resp.EvalID) return 0 }