diff --git a/edgelet/iotedge/src/check/checks/container_engine_logrotate.rs b/edgelet/iotedge/src/check/checks/container_engine_logrotate.rs index d4fdf4e037f..7c814cb08de 100644 --- a/edgelet/iotedge/src/check/checks/container_engine_logrotate.rs +++ b/edgelet/iotedge/src/check/checks/container_engine_logrotate.rs @@ -56,21 +56,20 @@ impl ContainerEngineLogrotate { self.daemon_config = Some(daemon_config.clone()); match daemon_config.log_driver.as_deref() { - Some("journald") => return Ok(CheckResult::Ok), - None => return Ok(CheckResult::Warning(anyhow!(MESSAGE))), - _ => (), - } + None | Some("json-file") => { + if let Some(log_opts) = &daemon_config.log_opts { + if log_opts.max_file.is_none() { + return Ok(CheckResult::Warning(anyhow!(MESSAGE))); + } - if let Some(log_opts) = &daemon_config.log_opts { - if log_opts.max_file.is_none() { - return Ok(CheckResult::Warning(anyhow!(MESSAGE))); + if log_opts.max_size.is_none() { + return Ok(CheckResult::Warning(anyhow!(MESSAGE))); + } + } else { + return Ok(CheckResult::Warning(anyhow!(MESSAGE))); + } } - - if log_opts.max_size.is_none() { - return Ok(CheckResult::Warning(anyhow!(MESSAGE))); - } - } else { - return Ok(CheckResult::Warning(anyhow!(MESSAGE))); + _ => (), } Ok(CheckResult::Ok)