From 9d49cd11bf9fcd6852a1f24b4414a14f88d874a1 Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Thu, 19 Oct 2023 13:46:14 -0700 Subject: [PATCH] Set a default write timeout Sets a default write timeout of 295 seconds to match the default read timeout. Signed-off-by: Alex Hunt --- kube-client/src/config/mod.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kube-client/src/config/mod.rs b/kube-client/src/config/mod.rs index ce5c9b57d..a02c48d0e 100644 --- a/kube-client/src/config/mod.rs +++ b/kube-client/src/config/mod.rs @@ -170,7 +170,7 @@ impl Config { root_cert: None, connect_timeout: Some(DEFAULT_CONNECT_TIMEOUT), read_timeout: Some(DEFAULT_READ_TIMEOUT), - write_timeout: None, + write_timeout: Some(DEFAULT_WRITE_TIMEOUT), accept_invalid_certs: false, auth_info: AuthInfo::default(), proxy_url: None, @@ -249,7 +249,7 @@ impl Config { root_cert: Some(root_cert), connect_timeout: Some(DEFAULT_CONNECT_TIMEOUT), read_timeout: Some(DEFAULT_READ_TIMEOUT), - write_timeout: None, + write_timeout: Some(DEFAULT_WRITE_TIMEOUT), accept_invalid_certs: false, auth_info: AuthInfo { token_file: Some(incluster_config::token_file()), @@ -309,7 +309,7 @@ impl Config { root_cert, connect_timeout: Some(DEFAULT_CONNECT_TIMEOUT), read_timeout: Some(DEFAULT_READ_TIMEOUT), - write_timeout: None, + write_timeout: Some(DEFAULT_WRITE_TIMEOUT), accept_invalid_certs, proxy_url: loader.proxy_url()?, auth_info: loader.user, @@ -377,6 +377,7 @@ fn certs(data: &[u8]) -> Result>, pem::PemError> { // https://github.com/kube-rs/kube/issues/146#issuecomment-590924397 const DEFAULT_CONNECT_TIMEOUT: Duration = Duration::from_secs(30); const DEFAULT_READ_TIMEOUT: Duration = Duration::from_secs(295); +const DEFAULT_WRITE_TIMEOUT: Duration = Duration::from_secs(295); // Expose raw config structs pub use file_config::{