Skip to content
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

new: introduce plugin loader code #56

Merged
merged 6 commits into from
Aug 5, 2022
Merged

new: introduce plugin loader code #56

merged 6 commits into from
Aug 5, 2022

Conversation

jasondellaluce
Copy link
Contributor

@jasondellaluce jasondellaluce commented Jun 14, 2022

What type of PR is this?

/kind feature

Any specific area of the project related to this PR?

/area plugin-sdk

What this PR does / why we need it:

Which issue(s) this PR fixes:

After the changes in libs of falcosecurity/libs#392 (yet to get merged), the plugin loading code is isolated in a self-contained package and implements a C api. As such, it is possible to develop loaders in other programming languages by reusing the libs one, which makes it compliant with the targeted libs version out of the box.

This first version of the loader is capable of loading plugins, validating them against the currently-supported plugin API version, and reading all their static/descriptive information (name, version, etc...). The loader is also capable of initializing the plugin in order to read initialization-dependent information such as the list of suggested open params.

Special notes for your reviewer:

Blocked and WIP until merging #63.

Since this PR is already big, unit tests and examples will be added in a future PR. Support for more operations on the loaded plugins will be considered in the future.

Most of the changes are related to pulling plugin_loader.h/.c from libs. The actual loader code is ~400 LOC and resides in pkg/loader/loader.go.

Does this PR introduce a user-facing change?:

new: introduce plugin loader code

@jasondellaluce
Copy link
Contributor Author

I splitted the libs version bump contribution to its own PR #63, and rebase this one on top of that. This PR is blocked until #63 gets merged.

/hold

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
@jasondellaluce
Copy link
Contributor Author

/unhold

Copy link
Member

@leogr leogr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great!
I can't wait to use this loader. 🤩

@poiana poiana added the lgtm label Aug 5, 2022
@poiana
Copy link

poiana commented Aug 5, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jasondellaluce, 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:
  • OWNERS [jasondellaluce,leogr]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana
Copy link

poiana commented Aug 5, 2022

LGTM label has been added.

Git tree hash: 49bab32022e779bcd7e02f26235d1a2d67520039

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants