-
Notifications
You must be signed in to change notification settings - Fork 917
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
Allow overwriting existing macros with conditions defined after them #1793
Allow overwriting existing macros with conditions defined after them #1793
Conversation
Closes: #706 Thanks to @fntlnz for providing a minimal working example. Now allowed: - macro: something_happens condition: (evt.num=0) - macro: something_else condition: (evt.num=1) # This -- usually seen in a local file -- was previously not # allowed, because during resolution of the /first/ something_happens, # the /then/ unknown something_else would be encountered. - macro: something_happens condition: (evt.num=2) or (something_else) Signed-off-by: Walter Doekes <[email protected]>
Welcome @wdoekes! It looks like this is your first PR to falcosecurity/falco 🎉 |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: wdoekes The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This is a great step forward. I haven't tested this, but my only concern is that this would also allow cases like this to be accepted:
Which kind brokes the ordering semantics. Did you test this specific case? |
Hey @wdoekes Thank you for this PR! |
/milestone 0.31.0 |
Yes. It accepts that case. I haven't tested it, but that's what the code (also) implies. Is there a reason why we would not want that? If there is, then the fix would've been to simply insert updated macros at the end of ordered_macros when loading them from yaml. Apparently there is a reason why you want to keep some kind of ordering. But I'm in the dark about what reasons you have. Keeping the original order whilst allowing the bugfix, but not your suggested case, seems to me like trying to fit a round peg through a square hole. |
Although I like this fix, I believe we have to rethink the whole sematic a bit. So, I'm moving it to the next milestone |
Hey @wdoekes, I was finally able to work on a refactoring of the rule loader 👉🏼 #1966 |
I'm closing this PR in favor of #1966 (that's already merged). |
@leogr: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Okay. I was finally able to test it. It works 👍 |
Thanks to @fntlnz for providing a minimal working example.
Now allowed:
/kind bug
/area rules
Fixes #706
Does this PR introduce a user-facing change?:
--
P.S. Unrelated to this PR. When I opened a PR, I got these tips:
If I wanted tips on how to compile Falco, I think I wouldn't be at the pull request stage. So that's weird. Also, the mentioned URL gives a 404.
The tip that isn't mentioned, but is found in the CONTRIBUTING docs, is the
-s
signed-off that is apparently mandatory. Maybe put that here.