diff --git a/.changelog/14492.txt b/.changelog/14492.txt new file mode 100644 index 000000000..f3117baf5 --- /dev/null +++ b/.changelog/14492.txt @@ -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 +``` \ No newline at end of file diff --git a/command/job_plan.go b/command/job_plan.go index 76a224ecc..7f71295cc 100644 --- a/command/job_plan.go +++ b/command/job_plan.go @@ -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 {