Skip to content

Commit

Permalink
Fix custom_client_tls example
Browse files Browse the repository at this point in the history
was not building on CI because it needs --all-features

Signed-off-by: clux <[email protected]>
  • Loading branch information
clux committed Oct 25, 2024
1 parent 4a63e81 commit 142b212
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/custom_client_tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use hyper_util::rt::TokioExecutor;
// Must enable `rustls-tls` feature to run this.
// Run with `USE_RUSTLS=1` to pick rustls.
use k8s_openapi::api::core::v1::Pod;
use tower::ServiceBuilder;
use tower::{BoxError, ServiceBuilder};
use tracing::*;

use kube::{client::ConfigExt, Api, Client, Config, ResourceExt};
Expand All @@ -21,13 +21,15 @@ async fn main() -> anyhow::Result<()> {
let service = ServiceBuilder::new()
.layer(config.base_uri_layer())
.option_layer(config.auth_layer()?)
.map_err(BoxError::from)
.service(hyper_util::client::legacy::Client::builder(TokioExecutor::new()).build(https));
Client::new(service, config.default_namespace)
} else {
let https = config.rustls_https_connector()?;
let service = ServiceBuilder::new()
.layer(config.base_uri_layer())
.option_layer(config.auth_layer()?)
.map_err(BoxError::from)
.service(hyper_util::client::legacy::Client::builder(TokioExecutor::new()).build(https));
Client::new(service, config.default_namespace)
};
Expand Down

0 comments on commit 142b212

Please sign in to comment.