-
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
Compile output clone #3364
Compile output clone #3364
Conversation
This PR may bring feature or behavior changes in the Falco engine and may require the engine version to be bumped. Please double check userspace/engine/falco_engine_version.h file. See versioning for FALCO_ENGINE_VERSION. /hold |
32d373f
to
1b77da9
Compare
Add a clone() method that can be overridden by subclasses. This allows copying compile state when needed in a way that preserves polymorphism. Signed-off-by: Mark Stemm <[email protected]>
Add an equality operator for indexed_vector. As indexed_vectors commonly hold falco lists/macros/rules, also add equality operators for those structs. For condition/sinsp_filter shared_ptrs, the operator checks that the shared_ptrs point to the same underlying memory. Signed-off-by: Mark Stemm <[email protected]>
Add a test for checking that compile_output::clone() returns equal values, specifically in the case of derived values. Signed-off-by: Mark Stemm <[email protected]>
1b77da9
to
42edde1
Compare
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, 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 |
LGTM label has been added. Git tree hash: 7591b4a273b704292ebb9c0f3c3a2dcfc5abd991
|
/unhold |
What type of PR is this?
/kind feature
Any specific area of the project related to this PR?
/area engine
What this PR does / why we need it:
This adds a clone() method for rule_loader::compile_output() that can be overridden by subclasses. This allows creating a mutable compile output in a polymorphic way.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: