Skip to content

Commit

Permalink
Fix no-tls build for Client
Browse files Browse the repository at this point in the history
excessive shadowing to avoid `connector` being an undefined var for no-tls build.
for #1333

Signed-off-by: clux <sszynrae@gmail.com>
  • Loading branch information
clux committed Oct 31, 2023
1 parent 56500da commit 48bc1ae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kube-client/src/client/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ impl TryFrom<Config> for ClientBuilder<GenericService> {

/// Helper function for implementation of [`TryFrom<Config>`] for [`ClientBuilder`].
/// Ignores [`Config::proxy_url`], which at this point is already handled.
fn make_generic_builder<H>(base_connector: H, config: Config) -> Result<ClientBuilder<GenericService>, Error>
fn make_generic_builder<H>(connector: H, config: Config) -> Result<ClientBuilder<GenericService>, Error>
where
H: 'static + Clone + Send + Sync + Service<http::Uri>,
H::Response: 'static + Connection + AsyncRead + AsyncWrite + Send + Unpin,
Expand All @@ -111,9 +111,9 @@ where
// Create a custom client to use something else.
// If TLS features are not enabled, http connector will be used.
#[cfg(feature = "rustls-tls")]
let connector = config.rustls_https_connector_with_connector(base_connector)?;
let connector = config.rustls_https_connector_with_connector(connector)?;
#[cfg(all(not(feature = "rustls-tls"), feature = "openssl-tls"))]
let connector = config.openssl_https_connector_with_connector(base_connector)?;
let connector = config.openssl_https_connector_with_connector(connector)?;

Check warning on line 116 in kube-client/src/client/builder.rs

View check run for this annotation

Codecov / codecov/patch

kube-client/src/client/builder.rs#L116

Added line #L116 was not covered by tests
#[cfg(all(not(feature = "rustls-tls"), not(feature = "openssl-tls")))]
if auth_layer.is_none() || config.cluster_url.scheme() == Some(&http::uri::Scheme::HTTPS) {
// no tls stack situation only works on anonymous auth with http scheme
Expand Down

0 comments on commit 48bc1ae

Please sign in to comment.