From 2234139fdabff78a00cf9585fec244a56a743906 Mon Sep 17 00:00:00 2001 From: goenning Date: Fri, 25 Oct 2024 05:22:10 +0100 Subject: [PATCH] conditionally install aws Signed-off-by: goenning --- kube-client/src/client/auth/oidc.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/kube-client/src/client/auth/oidc.rs b/kube-client/src/client/auth/oidc.rs index ecd8364e6..3a76b28cc 100644 --- a/kube-client/src/client/auth/oidc.rs +++ b/kube-client/src/client/auth/oidc.rs @@ -309,9 +309,13 @@ impl Refresher { let client_secret = get_field(Self::CONFIG_CLIENT_SECRET)?.into(); #[cfg(all(feature = "rustls-tls", feature = "aws-lc-rs"))] - rustls::crypto::aws_lc_rs::default_provider() - .install_default() - .unwrap(); + { + if rustls::crypto::CryptoProvider::get_default().is_none() { + // the only error here is if it's been initialized in between: we can ignore it + // since our semantic is only to set the default value if it does not exist. + let _ = rustls::crypto::aws_lc_rs::default_provider().install_default(); + } + } #[cfg(feature = "rustls-tls")] let https = hyper_rustls::HttpsConnectorBuilder::new()