mirror of
https://github.com/falcosecurity/falco.git
synced 2025-09-07 01:30:13 +00:00
Add an "Ok, with warnings" overall status.
In outputs it could be confusing to see a line: <filename>: Ok followed by a set of warnings. To differentiate this, add a top level status "Ok, with warnings" when rule loading was successful but had warnings. Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
This commit is contained in:
@@ -266,7 +266,19 @@ const std::string& rule_loader::result::as_summary_string()
|
|||||||
os << name << ": ";
|
os << name << ": ";
|
||||||
}
|
}
|
||||||
|
|
||||||
os << (success ? "Ok" : "Invalid");
|
if(success)
|
||||||
|
{
|
||||||
|
os << "Ok";
|
||||||
|
|
||||||
|
if (!warnings.empty())
|
||||||
|
{
|
||||||
|
os << ", with warnings";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
os << "Invalid";
|
||||||
|
}
|
||||||
|
|
||||||
if(!errors.empty())
|
if(!errors.empty())
|
||||||
{
|
{
|
||||||
@@ -326,7 +338,19 @@ const std::string& rule_loader::result::as_verbose_string(const rules_contents_t
|
|||||||
os << name << ": ";
|
os << name << ": ";
|
||||||
}
|
}
|
||||||
|
|
||||||
os << (success ? "Ok" : "Invalid");
|
if(success)
|
||||||
|
{
|
||||||
|
os << "Ok";
|
||||||
|
|
||||||
|
if (!warnings.empty())
|
||||||
|
{
|
||||||
|
os << ", with warnings";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
os << "Invalid";
|
||||||
|
}
|
||||||
|
|
||||||
if (!errors.empty())
|
if (!errors.empty())
|
||||||
{
|
{
|
||||||
|
@@ -102,8 +102,9 @@ application::run_result application::validate_rules_files()
|
|||||||
{
|
{
|
||||||
// If here, there must be only warnings.
|
// If here, there must be only warnings.
|
||||||
// Add a line to the summary noting that the
|
// Add a line to the summary noting that the
|
||||||
// file was ok without printing the warnings.
|
// file was ok with warnings, without actually
|
||||||
summary += filename + ": Ok";
|
// printing the warnings.
|
||||||
|
summary += filename + ": Ok, with warnings";
|
||||||
|
|
||||||
// If verbose is true, print the warnings now.
|
// If verbose is true, print the warnings now.
|
||||||
if(m_options.verbose)
|
if(m_options.verbose)
|
||||||
|
Reference in New Issue
Block a user