Skip to content

Commit

Permalink
Fix custom client tls ex (#1619)
Browse files Browse the repository at this point in the history
* Fix custom_client_tls example

was not building on CI because it needs --all-features

Signed-off-by: clux <[email protected]>

* all features example build

Signed-off-by: clux <[email protected]>

* all features in right place

Signed-off-by: clux <[email protected]>

---------

Signed-off-by: clux <[email protected]>
  • Loading branch information
clux authored Oct 25, 2024
1 parent 4a63e81 commit 2fbcbbe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
# Examples
- name: Test examples
if: matrix.os != 'windows-latest'
run: cargo test -p kube-examples --examples -j6
run: cargo test -p kube-examples --examples -j6 --all-features

doc:
runs-on: ubuntu-latest
Expand Down
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 2fbcbbe

Please sign in to comment.