From 25d349116d2fcb094b8c85e2c814e7ef9cff3731 Mon Sep 17 00:00:00 2001 From: Luca Guerra Date: Mon, 30 Sep 2024 11:20:22 +0000 Subject: [PATCH] fix(falco): allow disable_cri_async from both CLI and config Signed-off-by: Luca Guerra --- userspace/falco/app/actions/init_inspectors.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/userspace/falco/app/actions/init_inspectors.cpp b/userspace/falco/app/actions/init_inspectors.cpp index ab767f67410..cf3e3849d6c 100644 --- a/userspace/falco/app/actions/init_inspectors.cpp +++ b/userspace/falco/app/actions/init_inspectors.cpp @@ -67,7 +67,14 @@ static void init_syscall_inspector(falco::app::state& s, std::shared_ptr "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 @@ -79,13 +86,6 @@ static void init_syscall_inspector(falco::app::state& s, std::shared_ptr } } - // 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 //