From 905e9b5d1cba387ac48a79a2a3fbf630ff693d45 Mon Sep 17 00:00:00 2001 From: gabemontero Date: Thu, 1 Feb 2024 10:47:43 -0500 Subject: [PATCH] handle all terminal states when processing logs 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 --- pkg/watcher/reconciler/dynamic/dynamic.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/watcher/reconciler/dynamic/dynamic.go b/pkg/watcher/reconciler/dynamic/dynamic.go index 5242c68aa..1eddb2683 100644 --- a/pkg/watcher/reconciler/dynamic/dynamic.go +++ b/pkg/watcher/reconciler/dynamic/dynamic.go @@ -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 {