mirror of
https://github.com/falcosecurity/falco.git
synced 2025-07-13 14:34:33 +00:00
fix(userspace/falco): make sure validation summary is populated even when json output is requested
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
This commit is contained in:
parent
9ee0298c4d
commit
9d8f130f47
@ -89,8 +89,7 @@ application::run_result application::validate_rules_files()
|
|||||||
{
|
{
|
||||||
results.push_back(res->as_json(rc));
|
results.push_back(res->as_json(rc));
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if(summary != "")
|
if(summary != "")
|
||||||
{
|
{
|
||||||
summary += "\n";
|
summary += "\n";
|
||||||
@ -98,8 +97,7 @@ application::run_result application::validate_rules_files()
|
|||||||
|
|
||||||
// Add to the summary if not successful, or successful
|
// Add to the summary if not successful, or successful
|
||||||
// with no warnings.
|
// with no warnings.
|
||||||
if(!res->successful() ||
|
if(!res->successful() || (res->successful() && !res->has_warnings()))
|
||||||
(res->successful() && !res->has_warnings()))
|
|
||||||
{
|
{
|
||||||
summary += res->as_string(true, rc);
|
summary += res->as_string(true, rc);
|
||||||
}
|
}
|
||||||
@ -118,7 +116,6 @@ application::run_result application::validate_rules_files()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(m_state->config->m_json_output)
|
if(m_state->config->m_json_output)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user