Skip to content

Commit f968a1e

Browse files
authored
Update unexpected errror status conditions (#1811)
1 parent 838d416 commit f968a1e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/operator/resources/job/batchapi/cron.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ func checkForJobFailure(jobKey spec.JobKey, k8sJob *kbatch.Job) (bool, error) {
390390
job.SetWorkerErrorStatus(jobKey),
391391
deleteJobRuntimeResources(jobKey),
392392
)
393-
} else if int(k8sJob.Status.Succeeded) == 1 && len(pods) == 0 {
393+
} else if int(k8sJob.Status.Active) == 0 && int(k8sJob.Status.Failed) == 0 && len(pods) == 0 {
394394
// really unexpected situation which doesn't hurt if we check
395395
return true, errors.FirstError(
396396
job.SetUnexpectedErrorStatus(jobKey),

pkg/operator/resources/job/taskapi/cron.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ func checkIfJobCompleted(jobKey spec.JobKey, k8sJob *kbatch.Job) error {
221221
job.SetSucceededStatus(jobKey),
222222
deleteJobRuntimeResources(jobKey),
223223
)
224-
} else if int(k8sJob.Status.Succeeded) == 1 && len(pods) == 0 {
224+
} else if int(k8sJob.Status.Active) == 0 && int(k8sJob.Status.Failed) == 0 && len(pods) == 0 {
225225
// really unexpected situation which doesn't hurt if we check
226226
return errors.FirstError(
227227
job.SetUnexpectedErrorStatus(jobKey),

0 commit comments

Comments
 (0)