Closed jasondellaluce closed 2 years ago
LGTM label has been added.
[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
What type of PR is this?
/kind design
/kind feature
Any specific area of the project related to this PR?
/area plugin-sdk
/area tests
What this PR does / why we need it:
Following the updates of https://github.com/falcosecurity/libs/pull/175, this PR adds support for the
get_init_schema
function symbol to the Go SDK. An example of usage of the functionality, with ad-hoc documentation, is provided by updating thefull
plugin example.The new interface
sdk.InitSchema
has been introduce to return a pointer to asdk.SchemaInfo
.sdk.SchemaInfo
is a container for the returned schema, and can be updated in the future to also support schema types other than JSON Schema, if ever supported. As for now,InitSchema()
is expected to return a valid JSON Schema.Plugins can implement
sdk.InitSchema
optionally. If implemented, theInit()
method must expect a JSON string to be passed as a configuration, and can assume it to always be well-formed and automatically checked against the provided schema by the plugin framework. If not implemented, the init config must be considered as an opaque string (like we already do right now).Which issue(s) this PR fixes:
Special notes for your reviewer:
This depends on https://github.com/falcosecurity/libs/pull/175 and is noted as WIP until it gets merged.
Does this PR introduce a user-facing change?: