Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Commit 6156b63

Browse files
committed
Fix bug where scan was marked as done even though one of multiple persistence providers failed
1 parent 6b93334 commit 6156b63

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

operator/controllers/execution/scan_controller.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -662,13 +662,23 @@ func (r *ScanReconciler) startPersistenceProvider(scan *executionv1.Scan) error
662662
}
663663

664664
func allJobsCompleted(jobs *batch.JobList) jobCompletionType {
665+
hasFailed := false
666+
hasCompleted := true
667+
665668
for _, job := range jobs.Items {
666669
if job.Status.Failed > 0 {
667-
return failed
670+
hasFailed = true
668671
} else if job.Status.Succeeded == 0 {
669-
return incomplete
672+
hasCompleted = false
670673
}
671674
}
675+
676+
if hasFailed {
677+
return failed
678+
}
679+
if hasCompleted {
680+
return completed
681+
}
672682
return incomplete
673683
}
674684

0 commit comments

Comments
 (0)