Skip to content

Commit

Permalink
Set a default write timeout (#1314)
Browse files Browse the repository at this point in the history
Sets a default write timeout of 295 seconds to match the default read
timeout.

Signed-off-by: Alex Hunt <alex.hunt@materialize.com>
  • Loading branch information
alex-hunt-materialize authored Oct 27, 2023
1 parent 9cca823 commit 4083979
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions kube-client/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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()),
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -377,6 +377,7 @@ fn certs(data: &[u8]) -> Result<Vec<Vec<u8>>, 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::{
Expand Down

0 comments on commit 4083979

Please sign in to comment.