Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wait for pipelineloop-break-operation task final status #936

Merged
merged 1 commit into from
May 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -748,36 +748,40 @@ func (c *Reconciler) updatePipelineRunStatus(ctx context.Context, iterationEleme
}
for _, runStatus := range pr.Status.Runs {
if strings.HasPrefix(runStatus.PipelineTaskName, "pipelineloop-break-operation") {
err = c.cancelAllPipelineRuns(ctx, run)
if err != nil {
return 0, nil, nil, fmt.Errorf("could not cancel PipelineRuns belonging to Run %s."+
" %#v", run.Name, err)
if !runStatus.Status.GetCondition(apis.ConditionSucceeded).IsUnknown() {
err = c.cancelAllPipelineRuns(ctx, run)
if err != nil {
return 0, nil, nil, fmt.Errorf("could not cancel PipelineRuns belonging to Run %s."+
" %#v", run.Name, err)
}
// Mark run successful and stop the loop pipelinerun
run.Status.MarkRunSucceeded(pipelineloopv1alpha1.PipelineLoopRunReasonSucceeded.String(),
"PipelineRuns completed successfully with the conditions are met")
run.Status.Results = []runv1alpha1.RunResult{{
Name: "condition",
Value: "pass",
}}
break
}
// Mark run successful and stop the loop pipelinerun
run.Status.MarkRunSucceeded(pipelineloopv1alpha1.PipelineLoopRunReasonSucceeded.String(),
"PipelineRuns completed successfully with the conditions are met")
run.Status.Results = []runv1alpha1.RunResult{{
Name: "condition",
Value: "pass",
}}
break
}
}
for _, taskRunStatus := range pr.Status.TaskRuns {
if strings.HasPrefix(taskRunStatus.PipelineTaskName, "pipelineloop-break-operation") {
err = c.cancelAllPipelineRuns(ctx, run)
if err != nil {
return 0, nil, nil, fmt.Errorf("could not cancel PipelineRuns belonging to task run %s."+
" %#v", run.Name, err)
if !taskRunStatus.Status.GetCondition(apis.ConditionSucceeded).IsUnknown() {
err = c.cancelAllPipelineRuns(ctx, run)
if err != nil {
return 0, nil, nil, fmt.Errorf("could not cancel PipelineRuns belonging to task run %s."+
" %#v", run.Name, err)
}
// Mark run successful and stop the loop pipelinerun
run.Status.MarkRunSucceeded(pipelineloopv1alpha1.PipelineLoopRunReasonSucceeded.String(),
"PipelineRuns completed successfully with the conditions are met")
run.Status.Results = []runv1alpha1.RunResult{{
Name: "condition",
Value: "pass",
}}
break
}
// Mark run successful and stop the loop pipelinerun
run.Status.MarkRunSucceeded(pipelineloopv1alpha1.PipelineLoopRunReasonSucceeded.String(),
"PipelineRuns completed successfully with the conditions are met")
run.Status.Results = []runv1alpha1.RunResult{{
Name: "condition",
Value: "pass",
}}
break
}
}
}
Expand Down