mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
cli: fix detach handling (#13405)
Fix detach handling for: - `deployment fail` - `deployment promote` - `deployment resume` - `deployment unblock` - `job promote`
This commit is contained in:
3
.changelog/13405.txt
Normal file
3
.changelog/13405.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
```release-note:bug
|
||||
cli: Fixed remaining bugs where the evaluation ID was not printed when the `-detach` flag was passed
|
||||
``
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user