Skip to content

Commit

Permalink
Return evalID if -detach flag is passed to job revert (#13364)
Browse files Browse the repository at this point in the history
* Return evalID if `-detach` flag is passed to job revert
  • Loading branch information
hugespoon authored Jun 15, 2022
1 parent f233f74 commit da9f22f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .changelog/13364.txt
Original file line number Diff line number Diff line change
@@ -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
``
8 changes: 7 additions & 1 deletion command/job_revert.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit da9f22f

Please sign in to comment.