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

Feature: Add config setting to disable gzip compression #1627 #1628

Merged
merged 3 commits into from
Nov 19, 2024

Conversation

markdingram
Copy link
Contributor

Copy link

codecov bot commented Nov 5, 2024

Codecov Report

Attention: Patch coverage is 87.87879% with 4 lines in your changes missing coverage. Please review.

Project coverage is 75.5%. Comparing base (2ff5594) to head (535e186).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
kube-client/src/client/builder.rs 87.5% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1628     +/-   ##
=======================================
+ Coverage   75.3%   75.5%   +0.3%     
=======================================
  Files         82      82             
  Lines       7371    7403     +32     
=======================================
+ Hits        5550    5589     +39     
+ Misses      1821    1814      -7     
Files with missing lines Coverage Δ
kube-client/src/config/file_config.rs 75.2% <ø> (+1.0%) ⬆️
kube-client/src/config/mod.rs 53.4% <100.0%> (+8.4%) ⬆️
kube-client/src/client/builder.rs 64.2% <87.5%> (+8.3%) ⬆️

... and 1 file with indirect coverage changes

---- 🚨 Try these New Features:

@clux clux added the changelog-add changelog added category for prs label Nov 5, 2024
@clux clux added this to the 0.97.0 milestone Nov 5, 2024
@clux clux linked an issue Nov 5, 2024 that may be closed by this pull request
@@ -158,7 +158,13 @@ where
#[cfg(feature = "gzip")]
let stack = ServiceBuilder::new()
.layer(stack)
.layer(tower_http::decompression::DecompressionLayer::new())
.layer(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trying to wrap the whole layer in an "option_layer" block ran head first into a load of compile issues - fortunately the Compression Layer supports enabling/disabling through configuration hence that path was chosen

@markdingram
Copy link
Contributor Author

Remaining work on this PR is to add a test to check the Accept-Encoding header when the disabled flag is set

@markdingram markdingram force-pushed the disable-compression branch 3 times, most recently from 62c7009 to 71598b8 Compare November 6, 2024 23:03
@markdingram markdingram marked this pull request as ready for review November 7, 2024 12:17
Copy link
Member

@clux clux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thank you very much. Sensible porting of upstream behavior and sensible defaulting.

we've not historically been great at testing this area of the code base and this is a very nice way of doing it

kube-client/src/client/builder.rs Show resolved Hide resolved
@clux clux merged commit e0aa73d into kube-rs:main Nov 19, 2024
17 checks passed
@clux
Copy link
Member

clux commented Nov 19, 2024

Sorry for the late merge. Will get this released soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-add changelog added category for prs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add "disable-compression" to selectively disable Client Compression
2 participants