Implement chunking for gzip encoder in deferredResponseWriter
#130264
Labels
kind/feature
Categorizes issue or PR as related to a new feature.
sig/api-machinery
Categorizes an issue or PR as relevant to SIG API Machinery.
triage/accepted
Indicates an issue or PR is ready to be actively worked on.
What would you like to be added?
As pointed out in #129334 (comment) existing implementation of deferredResponseWriter assumes a single write when deciding whether gzip encoding is needed. We would extend writes to allow multiple calls to
Write
.To support multiple calls to
Write
and still make an accurate decision about whether to enablegzip
encoding, we will need to buffer the response until its size reach the gzip thresholddefaultGzipThresholdBytes
orClose
is called. At that point we can flush the buffer as it's no longer needed.As a prerequisite to this change we developed a test to validate the current chunking behavior in #130190. As part of this PR we want to flip
expectGzip
flag to true as part of"two small chunk writes"
scenario. Context #130190 (comment)Why is this needed?
Required to implement response streaming described in https://github.com/kubernetes/enhancements/tree/master/keps/sig-api-machinery/5116-streaming-response-encoding#streaming-collections-and-gzip-encoding
Tracked in kubernetes/enhancements#5116
The text was updated successfully, but these errors were encountered: