Skip to content

Commit

Permalink
Set a default write timeout
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 <[email protected]>
  • Loading branch information
alex-hunt-materialize committed Oct 19, 2023
1 parent c3fbe25 commit 9d49cd1
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),

Check warning on line 173 in kube-client/src/config/mod.rs

View check run for this annotation

Codecov / codecov/patch

kube-client/src/config/mod.rs#L173

Added line #L173 was not covered by tests
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),

Check warning on line 252 in kube-client/src/config/mod.rs

View check run for this annotation

Codecov / codecov/patch

kube-client/src/config/mod.rs#L252

Added line #L252 was not covered by tests
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 9d49cd1

Please sign in to comment.