Skip to content

Commit

Permalink
Update unexpected errror status conditions (#1811)
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalbollu authored Jan 20, 2021
1 parent 838d416 commit f968a1e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/operator/resources/job/batchapi/cron.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ func checkForJobFailure(jobKey spec.JobKey, k8sJob *kbatch.Job) (bool, error) {
job.SetWorkerErrorStatus(jobKey),
deleteJobRuntimeResources(jobKey),
)
} else if int(k8sJob.Status.Succeeded) == 1 && len(pods) == 0 {
} else if int(k8sJob.Status.Active) == 0 && int(k8sJob.Status.Failed) == 0 && len(pods) == 0 {
// really unexpected situation which doesn't hurt if we check
return true, errors.FirstError(
job.SetUnexpectedErrorStatus(jobKey),
Expand Down
2 changes: 1 addition & 1 deletion pkg/operator/resources/job/taskapi/cron.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func checkIfJobCompleted(jobKey spec.JobKey, k8sJob *kbatch.Job) error {
job.SetSucceededStatus(jobKey),
deleteJobRuntimeResources(jobKey),
)
} else if int(k8sJob.Status.Succeeded) == 1 && len(pods) == 0 {
} else if int(k8sJob.Status.Active) == 0 && int(k8sJob.Status.Failed) == 0 && len(pods) == 0 {
// really unexpected situation which doesn't hurt if we check
return errors.FirstError(
job.SetUnexpectedErrorStatus(jobKey),
Expand Down

0 comments on commit f968a1e

Please sign in to comment.