Skip to content

Commit

Permalink
When we have an error don't fail straight out
Browse files Browse the repository at this point in the history
When we made the fix for timeout (which include any errors) we would
exit straight away which would cause issues.

We are now just logging and let the flow continue to report.

Make sure we are not cleaning up pipeline with failures.

Signed-off-by: Chmouel Boudjnah <[email protected]>
  • Loading branch information
chmouel authored and Shivam Mukhade committed Apr 13, 2022
1 parent 1630e6c commit 1877a63
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/pipelineascode/pipelineascode.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ func Run(ctx context.Context, cs *params.Run, providerintf provider.Interface, k
cs.Clients.Log.Infof("Waiting for PipelineRun %s/%s to Succeed in a maximum time of %s minutes",
pr.Namespace, pr.Name, formatting.HumanDuration(cs.Info.Pac.DefaultPipelineRunTimeout))
if err := k8int.WaitForPipelineRunSucceed(ctx, cs.Clients.Tekton.TektonV1beta1(), pr, cs.Info.Pac.DefaultPipelineRunTimeout); err != nil {
return fmt.Errorf("pipelinerun %s in namespace %s has failed: %w", pipelineRun.GetGenerateName(), repo.GetNamespace(), err)
cs.Clients.Log.Errorf("pipelinerun has failed: %s", err.Error())
}

// Do cleanups
// Cleanup old succeeded pipelineruns
if keepMaxPipeline, ok := config["max-keep-runs"]; ok {
max, err := strconv.Atoi(keepMaxPipeline)
if err != nil {
Expand Down

0 comments on commit 1877a63

Please sign in to comment.