From d46f593a9864b8d9dd3039f47a766b09fb8ac77a Mon Sep 17 00:00:00 2001 From: Dawid Rusnak Date: Thu, 26 Sep 2024 09:54:58 +0200 Subject: [PATCH] fix: don't fetch logs for timed out services --- .../testworkflowcontroller/watchinstrumentedpod.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/testworkflows/testworkflowcontroller/watchinstrumentedpod.go b/pkg/testworkflows/testworkflowcontroller/watchinstrumentedpod.go index bd8bf5749b..a3e0ace239 100644 --- a/pkg/testworkflows/testworkflowcontroller/watchinstrumentedpod.go +++ b/pkg/testworkflows/testworkflowcontroller/watchinstrumentedpod.go @@ -67,7 +67,7 @@ func WatchInstrumentedPod(parentCtx context.Context, clientSet kubernetes.Interf } } - if watcher.State().PodStarted() || watcher.State().Completed() { + if watcher.State().PodStarted() || watcher.State().Completed() || opts.DisableFollow { break } } @@ -78,7 +78,7 @@ func WatchInstrumentedPod(parentCtx context.Context, clientSet kubernetes.Interf } // Handle the case when it has been complete without pod start - if !watcher.State().PodStarted() && watcher.State().Completed() { + if !watcher.State().PodStarted() && (watcher.State().Completed() || opts.DisableFollow) { notifier.Align(watcher.State()) return } @@ -141,7 +141,7 @@ func WatchInstrumentedPod(parentCtx context.Context, clientSet kubernetes.Interf } // Determine if the container should be already accessible - if watcher.State().ContainerStarted(container) || watcher.State().Completed() { + if watcher.State().ContainerStarted(container) || watcher.State().Completed() || opts.DisableFollow { break } } @@ -191,7 +191,7 @@ func WatchInstrumentedPod(parentCtx context.Context, clientSet kubernetes.Interf // Wait until the Container is terminated for ok := true; ok; _, ok = <-updatesCh { // Determine if the container should be already stopped - if watcher.State().ContainerFinished(container) || watcher.State().Completed() { + if watcher.State().ContainerFinished(container) || watcher.State().Completed() || opts.DisableFollow { break } }