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

Don't error if log reconnection fails due to context canceled #875

Merged
merged 3 commits into from
Oct 13, 2023
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
8 changes: 8 additions & 0 deletions pkg/workceptor/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,14 @@
for *stdinErr == nil { // check between every line read to see if we need to stop reading
line, err := streamReader.ReadString('\n')
if err != nil {
if kw.ctx.Err() == context.Canceled {
kw.Info(
"Context was canceled while reading logs for pod %s/%s. Assuming pod has finished",
podNamespace,
podName)

return
}

Check warning on line 249 in pkg/workceptor/kubernetes.go

View check run for this annotation

Codecov / codecov/patch

pkg/workceptor/kubernetes.go#L242-L249

Added lines #L242 - L249 were not covered by tests
kw.Info(
"Detected Error: %s for pod %s/%s. Will retry %d more times.",
err,
Expand Down
Loading