fix(userspace/engine): support appending to unknown sources

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
This commit is contained in:
Jason Dellaluce
2023-08-31 14:56:13 +00:00
committed by poiana
parent 88dcdaac8a
commit c8122ff474
5 changed files with 48 additions and 31 deletions

View File

@@ -568,12 +568,12 @@ void falco_engine::describe_rule(std::string *rule, bool json) const
output["lists"] = lists_array;
json_str = writer.write(output);
}
}
else
{
// build json information for just the specified rule
auto ri = m_rule_collector.rules().at(*rule);
if(ri == nullptr)
if(ri == nullptr || ri->unknown_source)
{
throw falco_exception("Rule \"" + *rule + "\" is not loaded");
}