mirror of https://github.com/k3s-io/k3s
Merge pull request #58249 from ilackarms/compression-flushing
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. periodically flush ResponseWriter when using response compression This PR fixes API Compression when following logs by ensuring the compression writer periodically flushes (at the end of each write). This is a commit extracted from #51508 to allow testing of flushing while feature remains disabled / in alpha. Fixes https://github.com/kubernetes/kubernetes/issues/54205 ```release-note NONE ```pull/6/head
commit
32dc50476e
|
@ -136,6 +136,7 @@ func (c *compressionResponseWriter) Write(p []byte) (int, error) {
|
|||
return -1, errors.New("compressing error: tried to write data using closed compressor")
|
||||
}
|
||||
c.Header().Set(headerContentEncoding, c.encoding)
|
||||
defer c.compressor.Flush()
|
||||
return c.compressor.Write(p)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue