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(configuration): support defining plugin init config as a YAML #1852

Merged
merged 3 commits into from
Jan 17, 2022

Conversation

jasondellaluce
Copy link
Contributor

What type of PR is this?

/kind cleanup

/kind design

/kind feature

Any specific area of the project related to this PR?

/area engine

What this PR does / why we need it:

This PR cleans up the plugin configuration reading, and supports init configs defined in YAML format. With this, users can define the init_config fields either as a string, or as a YAML map. In the first case, the string is opaque and passed as-is to the plugin framework of libs. In the second case, the YAML is parsed and converted to a JSON string. This is useful for two purposes:

The YAML data is converted in JSON format for simplicity and because that is the only schema-based data format we support as for falcosecurity/libs#175. This can easily be extended in the future to more formats if required, as the plugin-provided schema dictates the format expected by a given plugin.

Which issue(s) this PR fixes:

Special notes for your reviewer:

This also includes a minor fix to the changes introduced in #1792, and removes the init_config_file configuration field.

Does this PR introduce a user-facing change?:

new(configuration): support defining plugin init config as a YAML

This fixes the parser introduced in #1792.
Now, nested fields such as `arr[1].subval` are supported, whereas the parser used
to recognize the `.` as an unexpected character.

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

/milestone 0.31.0

@poiana
Copy link
Contributor

poiana commented Jan 13, 2022

@jasondellaluce: You must be a member of the falcosecurity/maintainers GitHub team to set the milestone. If you believe you should be able to issue the /milestone command, please contact your Falco maintainers and have them propose you as an additional delegate for this responsibility.

In response to this:

/milestone 0.31.0

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.

Copy link
Contributor

@mstemm mstemm left a comment

Choose a reason for hiding this comment

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

I don't feel that strongly about the recursion thing, so I'll approve just to skip some back and forth. But go for it if you'd like and I'll re-approve after.

case YAML::NodeType::Map:
for (auto &&it: node)
{
YAML::convert<nlohmann::json>::decode(it.second, sub);
Copy link
Contributor

Choose a reason for hiding this comment

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

Not that any legitimate use would do this, but we might want to cap the recursion at some big but fixed number of levels.

@poiana
Copy link
Contributor

poiana commented Jan 13, 2022

LGTM label has been added.

Git tree hash: 95d2da7736f54123bf6cf5919b09a0ba6f24506e

@jasondellaluce
Copy link
Contributor Author

/milestone 0.31.0

@poiana poiana added this to the 0.31.0 milestone Jan 14, 2022
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.

/approve

@poiana
Copy link
Contributor

poiana commented Jan 17, 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 poiana merged commit 4ab8d6d into master Jan 17, 2022
@poiana poiana deleted the update/rich-plugin-config branch January 17, 2022 13:55
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.

4 participants