mirror of
https://github.com/falcosecurity/falco.git
synced 2025-07-10 05:03:37 +00:00
fix(userspace/falco): solve tests issues
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
This commit is contained in:
parent
4aefb7fd7d
commit
db2f5d5e9c
@ -20,17 +20,31 @@ using namespace falco::app;
|
||||
|
||||
application::run_result application::load_config()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!m_options.conf_filename.empty())
|
||||
{
|
||||
m_state->config->init(m_options.conf_filename, m_options.cmdline_config_options);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_state->config->init(m_options.cmdline_config_options);
|
||||
}
|
||||
}
|
||||
catch (std::exception& e)
|
||||
{
|
||||
return run_result::fatal(e.what());
|
||||
}
|
||||
|
||||
// log after config init because config determines where logs go
|
||||
falco_logger::set_time_format_iso_8601(m_state->config->m_time_format_iso_8601);
|
||||
falco_logger::log(LOG_INFO, "Falco version: " + std::string(FALCO_VERSION) + " (" + std::string(FALCO_TARGET_ARCH) + ")\n");
|
||||
if (!m_state->cmdline.empty())
|
||||
{
|
||||
falco_logger::log(LOG_DEBUG, "CLI args: " + m_state->cmdline);
|
||||
}
|
||||
if (!m_options.conf_filename.empty())
|
||||
{
|
||||
m_state->config->init(m_options.conf_filename, m_options.cmdline_config_options);
|
||||
falco_logger::set_time_format_iso_8601(m_state->config->m_time_format_iso_8601);
|
||||
|
||||
// log after config init because config determines where logs go
|
||||
falco_logger::log(LOG_INFO, "Falco version: " + std::string(FALCO_VERSION) + " (" + std::string(FALCO_TARGET_ARCH) + ")\n");
|
||||
if (!m_state->cmdline.empty())
|
||||
{
|
||||
falco_logger::log(LOG_DEBUG, "CLI args: " + m_state->cmdline);
|
||||
}
|
||||
falco_logger::log(LOG_INFO, "Falco initialized with configuration file: " + m_options.conf_filename + "\n");
|
||||
}
|
||||
|
||||
|
@ -159,8 +159,6 @@ bool application::init(int argc, char **argv, std::string &errstr)
|
||||
m_state->cmdline += *arg;
|
||||
}
|
||||
|
||||
// initialize default config with cmdline overrides (-o option)
|
||||
m_state->config->init(m_options.cmdline_config_options);
|
||||
m_initialized = true;
|
||||
return true;
|
||||
}
|
||||
|
@ -319,7 +319,10 @@ void falco_configuration::load_yaml(const std::string& config_name, const yaml_h
|
||||
std::list<falco_configuration::plugin_config> plugins;
|
||||
try
|
||||
{
|
||||
config.get_sequence<std::list<falco_configuration::plugin_config>>(plugins, string("plugins"));
|
||||
if (config.is_defined("plugins"))
|
||||
{
|
||||
config.get_sequence<std::list<falco_configuration::plugin_config>>(plugins, string("plugins"));
|
||||
}
|
||||
}
|
||||
catch (exception &e)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user