cleanup plugin subprocesses on server exit

Signed-off-by: Steve Kriss <steve@heptio.com>
This commit is contained in:
Steve Kriss
2018-05-11 09:26:15 -07:00
parent 09c20b51e6
commit 20f56e9868
3 changed files with 17 additions and 2 deletions

View File

@@ -44,6 +44,7 @@ func baseConfig() *plugin.ClientConfig {
return &plugin.ClientConfig{
HandshakeConfig: Handshake,
AllowedProtocols: []plugin.Protocol{plugin.ProtocolGRPC},
Managed: true,
}
}
@@ -123,6 +124,9 @@ type Manager interface {
// CloseRestoreItemActions terminates the plugin sub-processes that
// are hosting RestoreItemAction plugins for the given restore name.
CloseRestoreItemActions(restoreName string) error
// CleanupClients kills all plugin subprocesses.
CleanupClients()
}
type manager struct {
@@ -411,3 +415,7 @@ func closeAll(store *clientStore, kind PluginKind, scope string) error {
return nil
}
func (m *manager) CleanupClients() {
plugin.CleanupClients()
}