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

Warn when trying to use an unsupported proxy protocol #1626

Merged
merged 2 commits into from
Nov 7, 2024

Conversation

nightkr
Copy link
Member

@nightkr nightkr commented Nov 5, 2024

It's confusing when users try to use it but end up unable because they don't know about the feature flags. Especially since this also isn't super visible in the API docs (since it's typically picked up from the environment variables or the kubeconfig).

kube-client/src/client/builder.rs Outdated Show resolved Hide resolved
@@ -104,14 +107,36 @@ impl TryFrom<Config> for ClientBuilder<GenericService> {
}

#[cfg(feature = "http-proxy")]
Some(proxy_url) if proxy_url.scheme_str() == Some("http") => {
Some(proxy_url) if proxy_url.scheme_str() == Some(PROXY_SCHEME_HTTP) => {
Copy link
Member Author

Choose a reason for hiding this comment

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

I just noticed that we only support HTTP proxies (rather than HTTPS), but that's probably out of scope for this PR.

@nightkr nightkr requested a review from a team November 5, 2024 09:25
Copy link

codecov bot commented Nov 5, 2024

Codecov Report

Attention: Patch coverage is 10.00000% with 9 lines in your changes missing coverage. Please review.

Project coverage is 75.3%. Comparing base (179936a) to head (e81e3ac).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
kube-client/src/client/builder.rs 10.0% 9 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1626     +/-   ##
=======================================
- Coverage   75.3%   75.3%   -0.0%     
=======================================
  Files         82      82             
  Lines       7344    7348      +4     
=======================================
  Hits        5528    5528             
- Misses      1816    1820      +4     
Files with missing lines Coverage Δ
kube-client/src/client/builder.rs 55.9% <10.0%> (-2.7%) ⬇️

Signed-off-by: Natalie Klestrup Röijezon <[email protected]>
@nightkr nightkr force-pushed the bugfix/warn-on-unsupported-proxy branch from 83b84a3 to e81e3ac Compare November 7, 2024 11:59
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.

Nice. Better user experience for sure.

@clux clux added the changelog-fix changelog fix category for prs label Nov 7, 2024
@clux clux added this to the 0.97.0 milestone Nov 7, 2024
@nightkr nightkr merged commit 9c402a6 into kube-rs:main Nov 7, 2024
17 checks passed
@clux clux mentioned this pull request Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-fix changelog fix category for prs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants