Skip to content

Commit

Permalink
iotedge check: Only verify logging options for json-file driver (whic…
Browse files Browse the repository at this point in the history
…h is the default).

This fixes #6754

NOTE: All other logging driver usually do logrotation on their own
  • Loading branch information
mtrensch committed Nov 21, 2022
1 parent ed1b6eb commit f0da82d
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions edgelet/iotedge/src/check/checks/container_engine_logrotate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f0da82d

Please sign in to comment.