Skip to content

Commit

Permalink
fix(falco): allow disable_cri_async from both CLI and config
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Guerra <[email protected]>
  • Loading branch information
LucaGuerra authored and poiana committed Sep 30, 2024
1 parent 10f87e5 commit f2d23af
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions userspace/falco/app/actions/init_inspectors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,14 @@ static void init_syscall_inspector(falco::app::state& s, std::shared_ptr<sinsp>
"Enabled container runtime socket at '" + p + "' via config file");
}
}
inspector->set_cri_async(!s.config->m_container_engines_disable_cri_async);

bool disable_cri_async =
s.config->m_container_engines_disable_cri_async || s.options.disable_cri_async;
inspector->set_cri_async(!disable_cri_async);

if(disable_cri_async) {
falco_logger::log(falco_logger::level::DEBUG, "Disabling async lookups for 'CRI'");
}

// Container engines configs via CLI args
// If required, set the CRI paths
Expand All @@ -79,13 +86,6 @@ static void init_syscall_inspector(falco::app::state& s, std::shared_ptr<sinsp>
}
}

// Decide whether to do sync or async for CRI metadata fetch
inspector->set_cri_async(!s.options.disable_cri_async);

if(s.options.disable_cri_async || s.config->m_container_engines_disable_cri_async) {
falco_logger::log(falco_logger::level::DEBUG, "Disabling async lookups for 'CRI'");
}

//
// If required, set the snaplen
//
Expand Down

0 comments on commit f2d23af

Please sign in to comment.