Skip to content

Commit

Permalink
Merge branch 'main' into socks5-proxy
Browse files Browse the repository at this point in the history
Signed-off-by: Eirik A <[email protected]>
  • Loading branch information
clux authored Oct 27, 2023
2 parents b76575c + 4083979 commit 6c31049
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 7 deletions.
2 changes: 0 additions & 2 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ name = "redox_syscall"

[[bans.skip-tree]]
name = "windows-sys"
[[bans.skip-tree]]
name = "windows"

[[bans.skip]]
# deep in dependency tree, dual use via tokio and hyper (needs a bump there)
Expand Down
2 changes: 1 addition & 1 deletion examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ latest = ["k8s-openapi/latest"]
[dev-dependencies]
tokio-util = "0.7.0"
assert-json-diff = "2.0.1"
garde = { version = "0.15.0", default-features = false, features = ["derive"] }
garde = { version = "0.16.1", default-features = false, features = ["derive"] }
anyhow = "1.0.44"
futures = "0.3.17"
jsonpath_lib = "0.3.0"
Expand Down
2 changes: 1 addition & 1 deletion kube-client/src/client/auth/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ fn auth_exec(auth: &ExecConfig) -> Result<ExecCredential, Error> {
// Provide exec info to child process
let exec_info = serde_json::to_string(&ExecCredential {
api_version: auth.api_version.clone(),
kind: None,
kind: "ExecCredential".to_string().into(),
spec: Some(ExecCredentialSpec {
interactive: Some(interactive),
}),
Expand Down
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
12 changes: 12 additions & 0 deletions kube-runtime/src/controller/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,18 @@ mod tests {
advance(Duration::from_secs(3)).await;
assert!(poll!(runner.as_mut()).is_pending());

// Send the third message again and check it's ran
sched_tx
.send(ScheduleRequest {
message: 3,
run_at: Instant::now(),
})
.await
.unwrap();
advance(Duration::from_secs(3)).await;
assert!(poll!(runner.as_mut()).is_pending());
assert_eq!(*count.lock().unwrap(), 4);

let (mut sched_tx, sched_rx) = mpsc::unbounded();
let mut runner = Box::pin(
Runner::new(scheduler(sched_rx), 1, |_| {
Expand Down
3 changes: 3 additions & 0 deletions kube-runtime/src/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ impl<'a, T: Hash + Eq + Clone, R> SchedulerProj<'a, T, R> {
pub fn pop_queue_message_into_pending(&mut self, cx: &mut Context<'_>) {
while let Poll::Ready(Some(msg)) = self.queue.poll_expired(cx) {
let msg = msg.into_inner();
self.scheduled.remove_entry(&msg).expect(
"Expired message was popped from the Scheduler queue, but was not in the metadata map",
);
self.pending.insert(msg);
}
}
Expand Down

0 comments on commit 6c31049

Please sign in to comment.