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 Azure#6754

NOTE: All other logging driver usually do logrotation on their own
  • Loading branch information
MTrensch-hilscher committed Nov 21, 2022
1 parent ed1b6eb commit e5864e5
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 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))),
_ => (),
}

if let Some(log_opts) = &daemon_config.log_opts {
if log_opts.max_file.is_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 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 e5864e5

Please sign in to comment.