File tree Expand file tree Collapse file tree
edgelet/iotedge/src/check/checks Expand file tree Collapse file tree Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments