Skip to content

Commit

Permalink
handle all terminal states when processing logs
Browse files Browse the repository at this point in the history
The prior check for whether the results Object had completed did not
account for objects which had been cancelled.  Rather then check every
conceivable terminal state, this commit instead makes sure it is not
in the Unknown state, which means it has not terminated.

rh-pre-commit.version: 2.1.0
rh-pre-commit.check-secrets: ENABLED
  • Loading branch information
gabemontero authored and tekton-robot committed Feb 2, 2024
1 parent ed1ffdb commit 905e9b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/watcher/reconciler/dynamic/dynamic.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ func (r *Reconciler) sendLog(ctx context.Context, o results.Object) error {
(GVK.Kind == "TaskRun" || GVK.Kind == "PipelineRun") &&
condition != nil &&
condition.Type == "Succeeded" &&
(condition.Reason == "Succeeded" || condition.Reason == "Completed" || condition.Reason == "Failed") {
!condition.IsUnknown() {

rec, err := r.resultsClient.GetLogRecord(ctx, o)
if err != nil {
Expand Down

0 comments on commit 905e9b5

Please sign in to comment.