From 01c1fd80b7758859a77e97be6d2e475c2ee5d145 Mon Sep 17 00:00:00 2001 From: Anusha Ragunathan Date: Fri, 24 Feb 2017 15:35:10 -0800 Subject: [PATCH] Net dial to the plugin socket during enable. When a plugin fails to start, we still incorrectly mark it as enabled. This change verifies that we can dial to the plugin socket to confirm that the plugin is functional and only then mark the plugin as enabled. Also, dont delete the plugin on install, if only the enable fails. Signed-off-by: Anusha Ragunathan Upstream-commit: 14e8332f2d079bc9ec2824809df81c8ef556bdc3 Component: cli --- components/cli/plugin_install.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/cli/plugin_install.go b/components/cli/plugin_install.go index 33876cc101..ce3e0506e5 100644 --- a/components/cli/plugin_install.go +++ b/components/cli/plugin_install.go @@ -60,8 +60,8 @@ func (cli *Client) PluginInstall(ctx context.Context, name string, options types return } - err = cli.PluginEnable(ctx, name, types.PluginEnableOptions{Timeout: 0}) - pw.CloseWithError(err) + enableErr := cli.PluginEnable(ctx, name, types.PluginEnableOptions{Timeout: 0}) + pw.CloseWithError(enableErr) }() return pr, nil }