-
Notifications
You must be signed in to change notification settings - Fork 466
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
Expose Runner interface to allow custom command runner implementations #270
Expose Runner interface to allow custom command runner implementations #270
Conversation
* Runner can be supplied by new config field RunnerFunc * Also adds SkipHostEnv config option * Adds optional environment variables to control plugin's unix socket * Adds CmdRunner as the default Runner implementation, maintaining existing functionality
hashicorp/go-secure-stdlib#84 has an alternative container-based implementation for any reviewers who'd like to compare with |
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.
LGTM!
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.
LGTM, one nit and one suggestion
Thanks! |
A set of small follow-ups to #270: * Make config.Cmd and config.RunnerFunc mutually exclusive * Explicitly mark ReattachConfig as unsupported for RunnerFunc clients * Improve 1 logger line for non-cmd implementations
A set of small follow-ups to #270: * Make config.Cmd and config.RunnerFunc mutually exclusive * Explicitly mark ReattachConfig as unsupported for RunnerFunc clients * Improve 1 logger line for non-cmd implementations * Add ID() function to client, useful for client's debug log information
A set of small follow-ups to #270: * Make config.Cmd and config.RunnerFunc mutually exclusive * Clients setting RunnerFunc can call ReattachConfig but need to supply their own ReattachFunc as it can't necessarily be derived from RunnerFunc. * Improve 1 logger line for non-cmd implementations * Add ID() function to client, useful for client's debug log information
A set of small follow-ups to #270: * Make `config.Cmd` and `config.RunnerFunc` mutually exclusive. * Clients setting `RunnerFunc` can call `ReattachConfig` but need to supply their own `ReattachFunc` as it can't necessarily be derived from `RunnerFunc`. Exercise `ReattachConfig()` in tests in a way that previously panicked. * Improve 1 logger line for non-cmd implementations. * Add `ID()` function to client; allows clients to construct a `ReattachFunc` and also useful for client's debug log information.
A set of small follow-ups to #270: * Make `config.Cmd` and `config.RunnerFunc` mutually exclusive. * Clients setting `RunnerFunc` can call `ReattachConfig` but need to supply their own `ReattachFunc` as it can't necessarily be derived from `RunnerFunc`. Exercise `ReattachConfig()` in tests in a way that previously panicked. * Improve 1 logger line for non-cmd implementations. * Add `ID()` function to client; allows clients to construct a `ReattachFunc` and also useful for client's debug log information.
A set of small follow-ups to #270: * Make `ClientConfig.Cmd` and `ClientConfig.RunnerFunc` mutually exclusive * Clients setting `RunnerFunc` can call `ReattachConfig()` but need to supply their own `ReattachFunc` as it can't necessarily be derived from `RunnerFunc`. Exercise `ReattachConfig()` in tests in a way that previously panicked. * Improve 1 logger line for non-cmd implementations. * Add `ID()` function to client; accommodates creating a `ReattachFunc` and also useful for client's debug log information.
runner
package to allow custom implementations for running plugins.RunnerFunc
can be supplied to customise how a plugin is run, with*exec.Cmd
treated as the spec.SkipHostEnv
tells go-plugin not to add the host process' environment variables to the command spec. Closes allow starting plugin without the host environment variables #104 and closes Allow overriding ambient environment variables #163ReattachConfig.ReattachFunc
can be supplied to hook into running plugins that are identified by something other than a process IDSee hashicorp/go-secure-stdlib#84 for an example implementation of
runner
's interfaces.Not planned (for now):