-
-
Notifications
You must be signed in to change notification settings - Fork 357
Open
Labels
clientkube Client relatedkube Client relatedhelp wantedNot immediately prioritised, please help!Not immediately prioritised, please help!
Description
Would you like to work on this feature?
yes
What problem are you trying to solve?
kube-rs currently supports the HTTP_PROXY (and all its variants) environment variable, but not the NO_PROXY var.
kube/kube-client/src/config/file_loader.rs
Lines 110 to 127 in be15f7a
pub fn proxy_url(&self) -> Result<Option<http::Uri>, KubeconfigError> { | |
let nonempty = |o: Option<String>| o.filter(|s| !s.is_empty()); | |
if let Some(proxy) = nonempty(self.cluster.proxy_url.clone()) | |
.or_else(|| nonempty(std::env::var("HTTP_PROXY").ok())) | |
.or_else(|| nonempty(std::env::var("http_proxy").ok())) | |
.or_else(|| nonempty(std::env::var("HTTPS_PROXY").ok())) | |
.or_else(|| nonempty(std::env::var("https_proxy").ok())) | |
{ | |
Ok(Some( | |
proxy | |
.parse::<http::Uri>() | |
.map_err(KubeconfigError::ParseProxyUrl)?, | |
)) | |
} else { | |
Ok(None) | |
} | |
} |
The NO_PROXY var is not standardised, but it's supported by Go and I think we could follow with similar support in here.
Describe the solution you'd like
change the proxy_url
fn so that if NO_PROXY is set and the content matches the cluster.server
url, return None
, otherwise continue as usual.
The matching impl could be similar to seanmonstar/reqwest#877
Describe alternatives you've considered
None
Documentation, Adoption, Migration Strategy
N/A
Target crate for feature
kube-client
Metadata
Metadata
Assignees
Labels
clientkube Client relatedkube Client relatedhelp wantedNot immediately prioritised, please help!Not immediately prioritised, please help!