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 16 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
22 changes: 11 additions & 11 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 42 files
+248 −31 Cargo.lock
+2 −0 Cargo.toml
+1 −1 Makefile
+72 −50 aziot/src/check_list.rs
+2 −2 aziot/src/init.rs
+1 −1 aziot/test-files/init/dps-symmetric-key/identityd.toml
+1 −1 aziot/test-files/init/dps-tpm/identityd.toml
+1 −1 aziot/test-files/init/dps-x509-pkcs11-est-bootstrap/identityd.toml
+1 −1 aziot/test-files/init/dps-x509-pkcs11-est/identityd.toml
+1 −1 aziot/test-files/init/dps-x509-pkcs11-localca/identityd.toml
+1 −1 aziot/test-files/init/dps-x509-pkcs11/identityd.toml
+1 −1 aziot/test-files/init/dps-x509/identityd.toml
+1 −1 aziot/test-files/init/manual-connection-string/identityd.toml
+1 −1 aziot/test-files/init/manual-symmetric-key/identityd.toml
+1 −1 aziot/test-files/init/manual-x509-pkcs11/identityd.toml
+1 −1 aziot/test-files/init/manual-x509/identityd.toml
+1 −1 aziotd/Cargo.toml
+3 −6 aziotd/src/error.rs
+25 −141 aziotd/src/main.rs
+2 −0 cert/aziot-certd/src/lib.rs
+1 −1 ci/e2e-tests.sh
+11 −0 config-common/Cargo.toml
+47 −0 config-common/src/error.rs
+168 −0 config-common/src/lib.rs
+36 −0 contrib/third-party-notices.sh
+2 −2 http-common/src/connector.rs
+3 −3 identity/aziot-identity-common/src/lib.rs
+7 −7 identity/aziot-identityd-config/src/lib.rs
+1 −1 identity/aziot-identityd-config/test/good_sas_config.toml
+3 −1 identity/aziot-identityd/Cargo.toml
+1 −2 identity/aziot-identityd/config/unix/default.toml
+3 −3 identity/aziot-identityd/src/auth/authentication.rs
+2 −3 identity/aziot-identityd/src/auth/authorization.rs
+4 −1 identity/aziot-identityd/src/auth/mod.rs
+36 −20 identity/aziot-identityd/src/configext.rs
+5 −0 identity/aziot-identityd/src/error.rs
+4 −1 identity/aziot-identityd/src/http/reprovision_device.rs
+397 −1 identity/aziot-identityd/src/identity.rs
+177 −515 identity/aziot-identityd/src/lib.rs
+1 −1 identity/aziot-identityd/test/good_auth_settings.toml
+2 −0 key/aziot-keyd/src/lib.rs
+2 −0 tpm/aziot-tpmd/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