Skip to content

Commit 31f8b5e

Browse files
Merge pull request #5054 from umohnani8/interruptbug
OCPBUGS-53390: Fix interrupt state to account for failure correctly
2 parents a09f116 + bb77142 commit 31f8b5e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/controller/build/imagebuilder/jobimagebuilder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ func (j *jobImageBuilder) validateBuilderType(builder buildrequest.Builder) erro
329329
func MapJobStatusToBuildStatus(job *batchv1.Job) (mcfgv1.BuildProgress, []metav1.Condition) {
330330
// If the job is being deleted and it was not in either a successful or failed state
331331
// then the MachineOSBuild should be considered "interrupted"
332-
if job.DeletionTimestamp != nil && job.Status.Succeeded == 0 && job.Status.Failed == 0 {
332+
if job.DeletionTimestamp != nil && job.Status.Succeeded == 0 && job.Status.Failed < constants.JobMaxRetries+1 {
333333
return mcfgv1.MachineOSBuildInterrupted, apihelpers.MachineOSBuildInterruptedConditions()
334334
}
335335

0 commit comments

Comments
 (0)