From 304adeeaa181046faf7639d8edf6d7552faf53a8 Mon Sep 17 00:00:00 2001 From: Yuhang Wei Date: Fri, 6 Dec 2024 03:40:19 +0000 Subject: [PATCH 1/2] test(kbimg): remove inappropriate test check_disk_space test rely on the machine free space. remove this test for now. Signed-off-by: Yuhang Wei --- KubeOS-Rust/kbimg/src/repo.rs | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/KubeOS-Rust/kbimg/src/repo.rs b/KubeOS-Rust/kbimg/src/repo.rs index 1a49645c..3f11d072 100644 --- a/KubeOS-Rust/kbimg/src/repo.rs +++ b/KubeOS-Rust/kbimg/src/repo.rs @@ -344,24 +344,3 @@ fn check_repo_file_valid(repo_path: &PathBuf) -> Result<()> { fn check_agent_file_valid(agent_path: &PathBuf) -> Result<()> { utils::is_file_valid("os-agent binary", agent_path) } - -#[cfg(test)] -mod tests { - use super::*; - - fn init() { - let _ = env_logger::builder() - .target(env_logger::Target::Stdout) - .filter_level(log::LevelFilter::Trace) - .is_test(true) - .try_init(); - } - - #[test] - fn test_check_disk_space_vm_repo() { - init(); - let image_type = "vm-repo".into(); - let result = check_disk_space(&image_type, &None); - assert!(result.is_ok()); - } -} -- Gitee From 27b45971acc334599c263155741de7ee45ebeeaa Mon Sep 17 00:00:00 2001 From: Yuhang Wei Date: Fri, 6 Dec 2024 03:41:33 +0000 Subject: [PATCH 2/2] build: bump hyper version to 0.14.31 update hyper version to 0.14.31 and format Cargo.toml Signed-off-by: Yuhang Wei --- Cargo.lock | 32 +++++++++++--------------------- Cargo.toml | 4 ++-- KubeOS-Rust/manager/Cargo.toml | 4 ++-- 3 files changed, 15 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 782a5e51..e031310f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -795,9 +795,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.25" +version = "0.14.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899" +checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" dependencies = [ "bytes", "futures-channel", @@ -809,7 +809,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.9", + "socket2", "tokio", "tower-service", "tracing", @@ -860,7 +860,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" dependencies = [ - "hyper 0.14.25", + "hyper 0.14.31", "pin-project-lite", "tokio", "tokio-io-timeout", @@ -873,7 +873,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper 0.14.25", + "hyper 0.14.31", "native-tls", "tokio", "tokio-native-tls", @@ -908,7 +908,7 @@ dependencies = [ "http-body 1.0.0", "hyper 1.4.1", "pin-project-lite", - "socket2 0.5.7", + "socket2", "tokio", "tower", "tower-service", @@ -1176,7 +1176,7 @@ dependencies = [ "futures", "http 0.2.12", "http-body 0.4.5", - "hyper 0.14.25", + "hyper 0.14.31", "hyper-timeout", "hyper-tls 0.5.0", "jsonpath_lib", @@ -1708,7 +1708,7 @@ dependencies = [ "env_logger", "futures", "http 0.2.12", - "hyper 0.14.25", + "hyper 0.14.31", "k8s-openapi", "kube", "log", @@ -1737,7 +1737,7 @@ dependencies = [ "quinn-udp", "rustc-hash", "rustls", - "socket2 0.5.7", + "socket2", "thiserror 1.0.64", "tokio", "tracing", @@ -1768,7 +1768,7 @@ checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" dependencies = [ "libc", "once_cell", - "socket2 0.5.7", + "socket2", "tracing", "windows-sys 0.59.0", ] @@ -2256,16 +2256,6 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" -[[package]] -name = "socket2" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "socket2" version = "0.5.7" @@ -2448,7 +2438,7 @@ dependencies = [ "num_cpus", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.7", + "socket2", "tokio-macros", "windows-sys 0.48.0", ] diff --git a/Cargo.toml b/Cargo.toml index 2c5bf9f1..45758925 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,13 +36,13 @@ reqwest = { version = "0.12.9", default-features = false } schemars = { version = "=0.8.21" } serde = { version = "1.0.215", features = ["derive"] } serde_json = { version = "1.0.133" } +serde_yaml = { version = "0.9.19" } sha2 = { version = "=0.10.8" } strfmt = { version = "0.2.4" } thiserror = { version = "2.0" } tokio = { version = "~1.38.0", default-features = false } tokio-retry = { version = "0.3" } toml = { version = "=0.7.6" } -serde_yaml = { version = "0.9.19"} # dev-dependencies mockall = { version = "=0.12.1" } @@ -55,7 +55,7 @@ tempfile = { version = "3.14.0" } # proxy dev-dependencies assert-json-diff = { version = "2.0" } http = { version = "=0.2.12" } -hyper = { version = "=0.14.25" } +hyper = { version = "=0.14.31" } tower-test = { version = "0.4.0" } [profile.release] diff --git a/KubeOS-Rust/manager/Cargo.toml b/KubeOS-Rust/manager/Cargo.toml index 70c7f22d..ed76a1e5 100644 --- a/KubeOS-Rust/manager/Cargo.toml +++ b/KubeOS-Rust/manager/Cargo.toml @@ -7,6 +7,7 @@ version.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dev-dependencies] +env_logger = { workspace = true } mockall = { workspace = true } mockito = { workspace = true } predicates = { workspace = true } @@ -14,7 +15,6 @@ tempfile = { workspace = true } [dependencies] anyhow = { workspace = true } -env_logger = { workspace = true } lazy_static = { workspace = true } log = { workspace = true } nix = { workspace = true } @@ -22,6 +22,6 @@ regex = { workspace = true } reqwest = { workspace = true, features = ["blocking", "default", "rustls-tls"] } serde = { workspace = true } serde_json = { workspace = true } -sha2 = { workspace = true } serde_yaml = { workspace = true } +sha2 = { workspace = true } toml = { workspace = true } -- Gitee