fix: pod logs streaming blocked by cleanResponseMiddleware buffering. Fixes #3470#3471
Draft
suryapratap-01 wants to merge 1 commit into
Draft
fix: pod logs streaming blocked by cleanResponseMiddleware buffering. Fixes #3470#3471suryapratap-01 wants to merge 1 commit into
suryapratap-01 wants to merge 1 commit into
Conversation
Signed-off-by: Surya Singh <suryapratap.personal@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3471 +/- ##
=======================================
Coverage 82.74% 82.74%
=======================================
Files 308 308
Lines 78697 78700 +3
=======================================
+ Hits 65115 65120 +5
+ Misses 13015 13013 -2
Partials 567 567 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
adarsh0728
reviewed
Jun 12, 2026
| return func(c *gin.Context) { | ||
| // Skip buffering for streaming endpoints (e.g. pod logs with follow=true), | ||
| // otherwise the response would never be written to the client. | ||
| if strings.HasSuffix(c.FullPath(), "/pods/:pod/logs") { |
Member
There was a problem hiding this comment.
we should implement a generic solution for future streaming endpoints eg:, new logs API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it
In v1.8.0 the UI logs panel is stuck on "Loading logs..." and
follow=truelog requests return zero bytes. (#3098) buffers the entire response body and only flushes it after the handler returns — butPodLogswithfollow=truestreams forever and never returns, so no bytes ever reach the client.Fix: skip the buffering for the
/pods/:pod/logsroute. It's the only streaming endpoint, returns plain text (nomanagedFieldsto strip), and auth middleware still runs.Related issues
Fixes #3470
Testing
go test ./server/routes/andmake lintpass.follow=truecurl → 200 with 0 bytes; with this fixa local build streams logs immediately and the UI panel works again.
Special notes for reviewers
Minimal route-scoped bypass, restores pre-1.8 behavior; no API changes.