From 9f2c7e47c9dacc8822d236972c6b1c5e28f6ec84 Mon Sep 17 00:00:00 2001 From: Hendrik Brueckner Date: Tue, 18 Oct 2022 11:12:18 +0000 Subject: [PATCH] Revert "kata-ctl: Disable network check on s390x" This reverts commit 00981b3c0a705e26691e519e4062689a1d6a258a. Signed-off-by: Hendrik Brueckner --- src/tools/kata-ctl/Cargo.toml | 5 +-- src/tools/kata-ctl/src/check.rs | 46 ------------------------- src/tools/kata-ctl/src/ops/check_ops.rs | 9 ----- 3 files changed, 1 insertion(+), 59 deletions(-) diff --git a/src/tools/kata-ctl/Cargo.toml b/src/tools/kata-ctl/Cargo.toml index b92491ecd9..094613c343 100644 --- a/src/tools/kata-ctl/Cargo.toml +++ b/src/tools/kata-ctl/Cargo.toml @@ -12,12 +12,9 @@ edition = "2018" [dependencies] anyhow = "1.0.31" clap = { version = "3.2.20", features = ["derive", "cargo"] } +reqwest = { version = "0.11", default-features = false, features = ["json", "blocking", "rustls-tls"] } serde_json = "1.0.85" thiserror = "1.0.35" -# See: https://github.com/kata-containers/kata-containers/issues/5438 -[target.'cfg(not(target_arch = "s390x"))'.dependencies] -reqwest = { version = "0.11", default-features = false, features = ["json", "blocking", "rustls-tls"] } - [dev-dependencies] semver = "1.0.12" diff --git a/src/tools/kata-ctl/src/check.rs b/src/tools/kata-ctl/src/check.rs index 2dbadeb545..28febb307c 100644 --- a/src/tools/kata-ctl/src/check.rs +++ b/src/tools/kata-ctl/src/check.rs @@ -6,19 +6,8 @@ // Contains checks that are not architecture-specific use anyhow::{anyhow, Result}; -// See: https://github.com/kata-containers/kata-containers/issues/5438 -#[cfg(any( - target_arch = "aarch64", - target_arch = "powerpc64le", - target_arch = "x86_64" -))] use reqwest::header::{CONTENT_TYPE, USER_AGENT}; use serde_json::Value; -#[cfg(any( - target_arch = "aarch64", - target_arch = "powerpc64le", - target_arch = "x86_64" -))] use std::collections::HashMap; use std::fs; @@ -110,11 +99,6 @@ pub fn run_network_checks() -> Result<()> { Ok(()) } -#[cfg(any( - target_arch = "aarch64", - target_arch = "powerpc64le", - target_arch = "x86_64" -))] fn get_kata_version_by_url(url: &str) -> std::result::Result { let content = reqwest::blocking::Client::new() .get(url) @@ -127,11 +111,6 @@ fn get_kata_version_by_url(url: &str) -> std::result::Result anyhow::Error { if e.is_connect() { return anyhow!(e).context("http connection failure: connection refused"); @@ -152,11 +131,6 @@ fn handle_reqwest_error(e: reqwest::Error) -> anyhow::Error { anyhow!(e).context("unknown http connection failure: {:?}") } -#[cfg(any( - target_arch = "aarch64", - target_arch = "powerpc64le", - target_arch = "x86_64" -))] pub fn check_version() -> Result<()> { let version = get_kata_version_by_url(KATA_GITHUB_URL).map_err(handle_reqwest_error)?; @@ -190,11 +164,6 @@ mod tests { assert_eq!(expected, actual); } - #[cfg(any( - target_arch = "aarch64", - target_arch = "powerpc64le", - target_arch = "x86_64" - ))] #[test] fn check_version_by_empty_url() { const TEST_URL: &str = "http:"; @@ -203,11 +172,6 @@ mod tests { assert_eq!(expected, actual); } - #[cfg(any( - target_arch = "aarch64", - target_arch = "powerpc64le", - target_arch = "x86_64" - ))] #[test] fn check_version_by_garbage_url() { const TEST_URL: &str = "_localhost_"; @@ -216,11 +180,6 @@ mod tests { assert_eq!(expected, actual); } - #[cfg(any( - target_arch = "aarch64", - target_arch = "powerpc64le", - target_arch = "x86_64" - ))] #[test] fn check_version_by_invalid_url() { const TEST_URL: &str = "http://localhost :80"; @@ -229,11 +188,6 @@ mod tests { assert_eq!(expected, actual); } - #[cfg(any( - target_arch = "aarch64", - target_arch = "powerpc64le", - target_arch = "x86_64" - ))] #[test] fn check_latest_version() { let version = get_kata_version_by_url(KATA_GITHUB_URL).unwrap(); diff --git a/src/tools/kata-ctl/src/ops/check_ops.rs b/src/tools/kata-ctl/src/ops/check_ops.rs index 80556894c8..b97cb6b05d 100644 --- a/src/tools/kata-ctl/src/ops/check_ops.rs +++ b/src/tools/kata-ctl/src/ops/check_ops.rs @@ -32,16 +32,7 @@ pub fn handle_check(checkcmd: CheckArgument) -> Result<()> { CheckSubCommand::CheckVersionOnly => { // retrieve latest release - #[cfg(any( - target_arch = "aarch64", - target_arch = "powerpc64le", - target_arch = "x86_64" - ))] check::check_version()?; - - // See: https://github.com/kata-containers/kata-containers/issues/5438 - #[cfg(target_arch = "s390x")] - unimplemented!("Network check not implemented on s390x") } }