-
Notifications
You must be signed in to change notification settings - Fork 552
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: plugin system (rebased) #2877
Conversation
A plugin is a binary that can communicate with ignite using github.com/hashicorp/go-plugin. When ignite is executed under a chain configuration, it checks if the config contains plugins. If yes the plugins are fetched, compiled and ran, which will add more commands to the existing ones. Fetching and compilation are cached under .ignite/plugins folder. A new command `ignite plugin` has been added to manage plugins and make new ones. To give plugins the ability to load the chain, the function `cmd.NewChainWithHomeFlags` is now public.
use hashicorp/go-plugin 1.4.4 to skip warning message
CI doesn't have any default git config.
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.
Are we running go mod tidy
when we "install" a new plugin?
If so, we don't need to include go.sum
we don't, but I'll add it and remove the go.sum 👍 |
@aljo242 I removed the go.sum and also all the indirect dependencies (we could probably do that also for chain |
* feat: plugin system A plugin is a binary that can communicate with ignite using github.com/hashicorp/go-plugin. When ignite is executed under a chain configuration, it checks if the config contains plugins. If yes the plugins are fetched, compiled and ran, which will add more commands to the existing ones. Fetching and compilation are cached under .ignite/plugins folder. A new command `ignite plugin` has been added to manage plugins and make new ones. To give plugins the ability to load the chain, the function `cmd.NewChainWithHomeFlags` is now public. * update plugin go.mod use hashicorp/go-plugin 1.4.4 to skip warning message * add plugin go.sum * git init and commit scaffolded plugins * update CL * fix dependecy issue * fix missing commit author when no default config CI doesn't have any default git config. * fix linter * Update ignite/services/plugin/template/main.go.plush Co-authored-by: Alex Johnson <[email protected]> * remove plugin go.sum and use gocmd * Update ignite/services/plugin/plugin.go Co-authored-by: Jerónimo Albi <[email protected]> * remove commented line * fix cannot use cmd.Context() there bc it's nil * kill plugin client at the end of execution * fix comment * improve error handling in LoadPlugins * remove plugin.Name The field has no real usage, it was here to have a shorter name than the path but dealing with the path is actually less confusing. * fix readme for plugins * fix: ensure plugin instances are killed * update main so defer funcs are honored * use const exit codes * go mod tidy * fix due to plushgen removal * add PR id to CL * change CL version * fix CL Co-authored-by: Alex Johnson <[email protected]> Co-authored-by: Jerónimo Albi <[email protected]>
A plugin is a binary that can communicate with ignite using
github.com/hashicorp/go-plugin. When ignite is executed under a chain
configuration, it checks if the config contains plugins. If yes the
plugins are fetched, compiled and ran, which will add more commands to
the existing ones.
Fetching and compilation are cached under .ignite/plugins folder.
A new command
ignite plugin
has been added to manage plugins and make newones.
To give plugins the ability to load the chain, the function
cmd.NewChainWithHomeFlags
is now public.This is a rebase of #1959, with some small additional changes: