Check that JobPlanResponse Diff Type is None before checking for changes on getExitCode (#14492)
This commit is contained in:
parent
40416be7b1
commit
b974c32ba6
|
@ -0,0 +1,3 @@
|
|||
```release-note:bug
|
||||
cli: Fixed a bug where plans for periodic jobs would return exit code 1 when the job was already register
|
||||
```
|
|
@ -391,6 +391,10 @@ type namespaceIdPair struct {
|
|||
// * 0: No allocations created or destroyed.
|
||||
// * 1: Allocations created or destroyed.
|
||||
func getExitCode(resp *api.JobPlanResponse) int {
|
||||
if resp.Diff.Type == "None" {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Check for changes
|
||||
for _, d := range resp.Annotations.DesiredTGUpdates {
|
||||
if d.Stop+d.Place+d.Migrate+d.DestructiveUpdate+d.Canary > 0 {
|
||||
|
|
Loading…
Reference in New Issue