Skip to content

Commit 2071f48

Browse files
committed
iotedge check: Only verify logging options for json-file driver (which is the default).
This fixes #6754 NOTE: All other logging driver usually do logrotation on their own
1 parent dc5c99e commit 2071f48

1 file changed

Lines changed: 12 additions & 13 deletions

File tree

edgelet/iotedge/src/check/checks/container_engine_logrotate.rs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,21 @@ impl ContainerEngineLogrotate {
5555
.context(MESSAGE)?;
5656
self.daemon_config = Some(daemon_config.clone());
5757

58-
match daemon_config.log_driver.as_deref() {
59-
Some("journald") => return Ok(CheckResult::Ok),
60-
None => return Ok(CheckResult::Warning(anyhow!(MESSAGE))),
61-
_ => (),
62-
}
63-
64-
if let Some(log_opts) = &daemon_config.log_opts {
65-
if log_opts.max_file.is_none() {
66-
return Ok(CheckResult::Warning(anyhow!(MESSAGE)));
67-
}
58+
if matches!(
59+
daemon_config.log_driver.as_deref(),
60+
Some("json-file") | None
61+
) {
62+
if let Some(log_opts) = &daemon_config.log_opts {
63+
if log_opts.max_file.is_none() {
64+
return Ok(CheckResult::Warning(anyhow!(MESSAGE)));
65+
}
6866

69-
if log_opts.max_size.is_none() {
67+
if log_opts.max_size.is_none() {
68+
return Ok(CheckResult::Warning(anyhow!(MESSAGE)));
69+
}
70+
} else {
7071
return Ok(CheckResult::Warning(anyhow!(MESSAGE)));
7172
}
72-
} else {
73-
return Ok(CheckResult::Warning(anyhow!(MESSAGE)));
7473
}
7574

7675
Ok(CheckResult::Ok)

0 commit comments

Comments
 (0)