-
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
new(configuration): support defining plugin init config as a YAML #1852
Conversation
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>
/milestone 0.31.0 |
@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:
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. |
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.
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); |
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.
Not that any legitimate use would do this, but we might want to cap the recursion at some big but fixed number of levels.
LGTM label has been added. Git tree hash: 95d2da7736f54123bf6cf5919b09a0ba6f24506e
|
/milestone 0.31.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 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 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 oflibs
. In the second case, the YAML is parsed and converted to a JSON string. This is useful for two purposes:-o
cli parameterThe 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?: