Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't fetch logs for timed out services #5870

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand All @@ -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
}
Expand Down Expand Up @@ -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
}
}
Expand Down Expand Up @@ -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
}
}
Expand Down
Loading