Skip to content

Commit 5e6e4cf

Browse files
authored
do not mark failed until all running PRs are done (kubeflow#1037)
1 parent 24afc39 commit 5e6e4cf

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

tekton-catalog/pipeline-loops/pkg/reconciler/pipelinelooprun/pipelinelooprun.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,11 +477,19 @@ func (c *Reconciler) reconcile(ctx context.Context, run *v1alpha1.Run, status *p
477477
}
478478

479479
// Check the status of the PipelineRun for the highest iteration.
480-
for _, failedPr := range failedPrs {
481-
run.Status.MarkRunFailed(pipelineloopv1alpha1.PipelineLoopRunReasonFailed.String(),
482-
"PipelineRun %s has failed", failedPr.Name)
480+
if len(failedPrs) > 0 {
481+
for _, failedPr := range failedPrs {
482+
if status.CurrentRunning == 0 {
483+
run.Status.MarkRunFailed(pipelineloopv1alpha1.PipelineLoopRunReasonFailed.String(),
484+
"PipelineRun %s has failed", failedPr.Name)
485+
} else {
486+
run.Status.MarkRunRunning(pipelineloopv1alpha1.PipelineLoopRunReasonRunning.String(),
487+
"PipelineRun %s has failed", failedPr.Name)
488+
}
489+
}
483490
return nil
484491
}
492+
485493
// Mark run status Running
486494
run.Status.MarkRunRunning(pipelineloopv1alpha1.PipelineLoopRunReasonRunning.String(),
487495
"Iterations completed: %d", highestIteration-len(currentRunningPrs))

0 commit comments

Comments
 (0)