Skip to content

Commit

Permalink
Error sweep: fix error messages for timing out Runs
Browse files Browse the repository at this point in the history
This commit fixes the user facing error messages for timing out Runs as
well as the controller logs.

/kind misc
  • Loading branch information
JeromeJu committed Jan 16, 2024
1 parent edbb41e commit 0ee83c3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/reconciler/pipelinerun/timeout.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,19 +110,19 @@ func timeoutPipelineTasksForTaskNames(ctx context.Context, logger *zap.SugaredLo
}

for _, taskRunName := range trNames {
logger.Infof("cancelling TaskRun %s for timeout", taskRunName)
logger.Infof("patching TaskRun %s for timeout", taskRunName)

if _, err := clientSet.TektonV1().TaskRuns(pr.Namespace).Patch(ctx, taskRunName, types.JSONPatchType, timeoutTaskRunPatchBytes, metav1.PatchOptions{}, ""); err != nil {
errs = append(errs, fmt.Errorf("failed to patch TaskRun `%s` with cancellation: %w", taskRunName, err).Error())
errs = append(errs, fmt.Errorf("failed to patch TaskRun `%s` with timeout: %w", taskRunName, err).Error())
continue
}
}

for _, custonRunName := range customRunNames {
logger.Infof("cancelling CustomRun %s for timeout", custonRunName)
logger.Infof("patching CustomRun %s for timeout", custonRunName)

if err := timeoutCustomRun(ctx, custonRunName, pr.Namespace, clientSet); err != nil {
errs = append(errs, fmt.Errorf("failed to patch CustomRun `%s` with cancellation: %w", custonRunName, err).Error())
errs = append(errs, fmt.Errorf("failed to patch CustomRun `%s` with timeout: %w", custonRunName, err).Error())
continue
}
}
Expand Down

0 comments on commit 0ee83c3

Please sign in to comment.