-
Notifications
You must be signed in to change notification settings - Fork 905
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(userspace/falco): deprecate old 'rules_file' config key. #3162
Conversation
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
/hold for discussion |
/cc @leogr |
/milestone 0.38.0 |
@@ -167,6 +167,18 @@ void falco_configuration::merge_configs_files(const std::string& config_name, st | |||
} | |||
} | |||
|
|||
void falco_configuration::init_logger() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is somewhat a fix: initialize the logger before loading anything else from the config; this allows us to log at the correct level in case we need to.
NOTE: this wasn't a bug since no logging was present in the yaml loading phase in configuration.cpp; but now we have to log a warning when both new and old keys are defined.
All in all, logging is quite always the first thing that needs to be inited, thus the change.
load_engine_config(config_name); | ||
m_log_level = config.get_scalar<std::string>("log_level", "info"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was done twice :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall SGTM,
just left a comment for the doc comment :D
Co-authored-by: Leonardo Grasso <me@leonardograsso.com> Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
c5cabcd
to
27fe089
Compare
/cc @incertum |
} | ||
if (num_rules_files_opts == 2) | ||
{ | ||
throw std::logic_error("Error reading config file (" + config_name + "): both 'rules_files' and 'rules_file' keys set"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throw std::logic_error("Error reading config file (" + config_name + "): both 'rules_files' and 'rules_file' keys set"); | |
throw std::logic_error("Error reading config file (" + config_name + "): both 'rules_files' (plural form) and 'rules_file' (singular form) keys set. Please only use new 'rules_files' config key (plural form)."); |
LGTM, just minor rewording suggestion. |
Co-authored-by: Melissa Kilby <melissa.kilby.oss@gmail.com> Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
5b6882b
to
04f95fc
Compare
Thanks Melissa, agreed with the clarification, committed :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: FedeDP, incertum, leogr The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Going to unhold in a couple of minutes, waiting for master CI to end. |
/unhold |
What type of PR is this?
/kind cleanup
Any specific area of the project related to this PR?
/area engine
What this PR does / why we need it:
Deprecates old 'rules_file' config option in favor of new 'rules_files'.
Old config option is still kept for backward compatiblity (and will possibly go away with Falco 1.0.0).
So:
rules_files
present -> ok we use itrules_file
present -> ok we use it but give a warning about deprecationExample output:
rules_file
present:Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: