-
Notifications
You must be signed in to change notification settings - Fork 912
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
Ignore unknown sources rules macros #1920
Conversation
If a rule has an unknown source, *and* has exceptions, loading the rule will result in an error and not skipping the rule. This is because exceptions are also validated for unknown fields, and that occurs before the current check for unknown sources. The fix is to move the check for unknown sources as soon as the rules object is read. Signed-off-by: Mark Stemm <[email protected]>
Also skip macros with unknown sources. This matters primarily for macros related to plugins that have a distinct event source. Signed-off-by: Mark Stemm <[email protected]>
Add new test cases for a rule with an unknown source *and* an exception, and a macro with an unknown source. The first results in a rule warning (and no error), and the second prints an error and skips. Signed-off-by: Mark Stemm <[email protected]>
/milestone 0.32.0 |
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
LGTM label has been added. Git tree hash: 5fa465531de61503ca7d405170f5c96f5103cf11
|
/milestone 0.32.0 |
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: jasondellaluce, leogr, mstemm 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 |
What type of PR is this?
/kind bug
Any specific area of the project related to this PR?
/area engine
What this PR does / why we need it:
Fix a bug where rules with unknown sources and exceptions, or macros with unknown sources, resulted in errors instead of warnings.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: