Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iotedge check update #4153

Merged
merged 20 commits into from
Jan 22, 2021
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 20 additions & 14 deletions edgelet/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion edgelet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ members = [
"identity-client",
"iotedge",
"management",
"mini-sntp",
"systemd",
]

Expand Down
2 changes: 1 addition & 1 deletion edgelet/aziot
Submodule aziot updated 52 files
+239 −34 Cargo.lock
+3 −0 Cargo.toml
+1 −1 Makefile
+16 −2 aziot/Cargo.toml
+10 −0 aziot/aziot-check-common/Cargo.toml
+59 −0 aziot/aziot-check-common/src/lib.rs
+331 −0 aziot/src/check.rs
+76 −0 aziot/src/check_list.rs
+55 −67 aziot/src/init.rs
+191 −0 aziot/src/internal/check/additional_info.rs
+241 −0 aziot/src/internal/check/checks/cert_expiry.rs
+76 −0 aziot/src/internal/check/checks/certs_preloaded.rs
+129 −0 aziot/src/internal/check/checks/daemons_running.rs
+68 −0 aziot/src/internal/check/checks/host_connect_dps_endpoint.rs
+125 −0 aziot/src/internal/check/checks/host_connect_iothub.rs
+73 −0 aziot/src/internal/check/checks/host_local_time.rs
+200 −0 aziot/src/internal/check/checks/hostname.rs
+51 −0 aziot/src/internal/check/checks/mod.rs
+200 −0 aziot/src/internal/check/checks/well_formed_configs.rs
+116 −0 aziot/src/internal/check/mod.rs
+42 −0 aziot/src/internal/check/util.rs
+112 −0 aziot/src/internal/common.rs
+4 −0 aziot/src/internal/mod.rs
+24 −29 aziot/src/main.rs
+1 −1 aziot/test-files/init/README.md
+2 −1 cert/aziot-certd-config/Cargo.toml
+8 −1 cert/aziot-certd-config/src/lib.rs
+69 −0 cert/aziot-certd-config/src/util.rs
+1 −1 cert/aziot-certd/Cargo.toml
+42 −80 cert/aziot-certd/src/lib.rs
+5 −0 contrib/centos/aziot-identity-service.spec
+3 −0 contrib/debian/control
+6 −0 contrib/third-party-notices.sh
+1 −1 docs/dev/building.md
+38 −5 docs/identity-service.md
+2 −2 docs/packaging.md
+0 −1 http-common/Cargo.toml
+0 −2 identity/aziot-dps-client-async/Cargo.toml
+2 −2 identity/aziot-dps-client-async/src/lib.rs
+0 −2 identity/aziot-hub-client-async/Cargo.toml
+0 −1 identity/aziot-identity-common-http/Cargo.toml
+8 −0 identity/aziot-identity-common-http/src/lib.rs
+14 −0 identity/aziot-identity-common/src/lib.rs
+61 −0 identity/aziot-identityd-config/src/check.rs
+20 −38 identity/aziot-identityd-config/src/lib.rs
+1 −57 identity/aziot-identityd/src/configext.rs
+1 −1 identity/aziot-identityd/src/http/create_or_list_module_identity.rs
+107 −88 identity/aziot-identityd/src/lib.rs
+9 −0 mini-sntp/Cargo.toml
+91 −0 mini-sntp/src/error.rs
+343 −0 mini-sntp/src/lib.rs
+1 −1 openssl-build/src/lib.rs
4 changes: 2 additions & 2 deletions edgelet/iotedge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ url = "2"
zip = "0.5.3"

aziot-certd-config = { path = "../aziot/cert/aziot-certd-config" }
aziot-check-common = { path = "../aziot/aziot/aziot-check-common" }
aziot-identity-common = { path = "../aziot/identity/aziot-identity-common" }
aziot-identityd-config = { path = "../aziot/identity/aziot-identityd-config" }
aziot-keyd-config = { path = "../aziot/key/aziot-keyd-config" }
Expand All @@ -49,9 +50,9 @@ edgelet-http = { path = "../edgelet-http" }
edgelet-http-mgmt = { path = "../edgelet-http-mgmt" }
edgelet-utils = { path = "../edgelet-utils" }
management = { path = "../management" }
mini-sntp = { path = "../mini-sntp" }
support-bundle = { path = "../support-bundle" }


[target.'cfg(unix)'.dependencies]
byte-unit = "3.0.3"
libc = "0.2"
Expand All @@ -60,4 +61,3 @@ sysinfo = "0.14.10"
[dev-dependencies]
edgelet-test-utils = { path = "../edgelet-test-utils" }
tempfile = "3.1.0"

4 changes: 0 additions & 4 deletions edgelet/iotedge/src/check/checks/aziot_edged_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ impl AziotEdgedVersion {
let mut process = Command::new(&check.aziot_edged);
process.arg("--version");

if cfg!(windows) {
process.env("IOTEDGE_RUN_AS_CONSOLE", "true");
}

let output = process
.output()
.context("Could not spawn aziot-edged process")?;
Expand Down
113 changes: 0 additions & 113 deletions edgelet/iotedge/src/check/checks/certificates_quickstart.rs

This file was deleted.

6 changes: 0 additions & 6 deletions edgelet/iotedge/src/check/checks/connect_management_uri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,6 @@ impl ConnectManagementUri {
connect_management_uri.to_uds_file_path()
.context("Could not parse connect.management_uri: does not represent a valid file path")?;

// On Windows we mount the parent folder because we can't mount the socket files directly
#[cfg(windows)]
let socket_path =
socket_path.parent()
.ok_or_else(|| Context::new("Could not parse connect.management_uri: does not have a parent directory"))?;

let socket_path =
socket_path.to_str()
.ok_or_else(|| Context::new("Could not parse connect.management_uri: file path is not valid utf-8"))?;
Expand Down
2 changes: 1 addition & 1 deletion edgelet/iotedge/src/check/checks/container_engine_dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl ContainerEngineDns {
.context(MESSAGE)?;
self.dns = daemon_config.dns.clone();

if let Some(&[]) | None = daemon_config.dns.as_ref().map(std::ops::Deref::deref) {
if daemon_config.dns.map_or(true, |e| e.is_empty()) {
return Ok(CheckResult::Warning(Context::new(MESSAGE).into()));
}

Expand Down
18 changes: 3 additions & 15 deletions edgelet/iotedge/src/check/checks/container_engine_installed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,9 @@ impl ContainerEngineInstalled {
);

if let Some(message) = message {
#[cfg(unix)]
{
if message.contains("Got permission denied") {
error_message += "\nYou might need to run this command as root.";
return Ok(CheckResult::Fatal(err.context(error_message).into()));
}
}

#[cfg(windows)]
{
if message.contains("Access is denied") {
error_message +=
"\nYou might need to run this command as Administrator.";
return Ok(CheckResult::Fatal(err.context(error_message).into()));
}
if message.contains("Got permission denied") {
error_message += "\nYou might need to run this command as root.";
return Ok(CheckResult::Fatal(err.context(error_message).into()));
}
}

Expand Down
17 changes: 9 additions & 8 deletions edgelet/iotedge/src/check/checks/container_engine_ipv6.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ impl ContainerEngineIPv6 {
let daemon_config_file = match daemon_config_file {
Ok(daemon_config_file) => daemon_config_file,
Err(err) => {
if is_edge_ipv6_configured {
return Err(err.context(MESSAGE).into());
return if is_edge_ipv6_configured {
Err(err.context(MESSAGE).into())
} else {
return Ok(CheckResult::Ignored);
Ok(CheckResult::Ignored)
}
}
};
Expand All @@ -72,11 +72,12 @@ impl ContainerEngineIPv6 {
.context(MESSAGE)?;
self.actual_use_ipv6 = daemon_config.ipv6;

match (daemon_config.ipv6.unwrap_or_default(), is_edge_ipv6_configured) {
(true, _) if cfg!(windows) => Err(Context::new("IPv6 container network configuration is not supported for the Windows operating system.").into()),
(true, _) => Ok(CheckResult::Ok),
(false, true) => Err(Context::new(MESSAGE).into()),
(false, false) => Ok(CheckResult::Ignored),
if daemon_config.ipv6.unwrap_or_default() {
Ok(CheckResult::Ok)
} else if is_edge_ipv6_configured {
Err(Context::new(MESSAGE).into())
} else {
Ok(CheckResult::Ignored)
}
}
}
Expand Down
16 changes: 0 additions & 16 deletions edgelet/iotedge/src/check/checks/container_engine_is_moby.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,6 @@ impl ContainerEngineIsMoby {
return Ok(CheckResult::Skipped);
};

#[cfg(windows)]
{
let settings = if let Some(settings) = &check.settings {
settings
} else {
return Ok(CheckResult::Skipped);
};

let moby_runtime_uri = settings.moby_runtime().uri().to_string();
self.moby_runtime_uri = Some(moby_runtime_uri.clone());

if moby_runtime_uri != "npipe://./pipe/iotedge_moby_engine" {
return Ok(CheckResult::Warning(Context::new(MESSAGE).into()));
}
}

let docker_server_major_version = docker_server_version
.split('.')
.next()
Expand Down
Loading