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

feat: adding validate and unload plugin schema functionality #15

Merged
merged 2 commits into from
May 17, 2022

Conversation

mikefero
Copy link
Contributor

These feature additions allow for plugin:

  • schema to be validated loading and potentially overriding plugin definitions which have already been loaded into the plugins subschemas definitions
  • unloading of plugin schemas; useful for removing a plugin schema during runtime

@mikefero mikefero requested a review from a team as a code owner May 13, 2022 14:43
return nil, tostring(errors:schema_violation(err_t))
end
return plugin_schema.name, nil
end
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In future versions of goks we might want to consider removing the code duplication in load_plugin_schema and update the signature to require the plugin_name and plugin_schema_string. If we decide to keep the schema validation in the load_plugin_schema function we should look at using local functions and exposing them in the return in order to remove some duplicated code.

internal/vm/setup.go Outdated Show resolved Hide resolved
internal/vm/setup.go Outdated Show resolved Hide resolved
internal/vm/setup.go Outdated Show resolved Hide resolved
Copy link
Member

@hbagdi hbagdi left a comment

Choose a reason for hiding this comment

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

LGTM. Go ahead and merge after this change.

plugin/validator_test.go Show resolved Hide resolved
@mikefero mikefero force-pushed the validate-and-unload-schema branch from 2c2ac15 to 6edbe46 Compare May 17, 2022 20:42
These feature additions allow for plugin:

* validating of schema; validates and tests loading of plugin schema
* unloading of plugin schemas; useful for removing a plugin schema
  during runtime
@mikefero mikefero force-pushed the validate-and-unload-schema branch from 6edbe46 to 8ce5395 Compare May 17, 2022 20:43
@mikefero mikefero merged commit c4250db into main May 17, 2022
@mikefero mikefero deleted the validate-and-unload-schema branch May 17, 2022 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants