From 0bab6d9449581af59e8b6685540a7c8470417cd6 Mon Sep 17 00:00:00 2001 From: Lars Lehtonen Date: Thu, 3 Sep 2020 19:56:50 -0700 Subject: [PATCH] client/allocrunner/taskrunner: client.Close after err check --- client/allocrunner/taskrunner/plugin_supervisor_hook.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/allocrunner/taskrunner/plugin_supervisor_hook.go b/client/allocrunner/taskrunner/plugin_supervisor_hook.go index b95daa857694..2ccb09627cfb 100644 --- a/client/allocrunner/taskrunner/plugin_supervisor_hook.go +++ b/client/allocrunner/taskrunner/plugin_supervisor_hook.go @@ -260,10 +260,10 @@ func (h *csiPluginSupervisorHook) registerPlugin(socketPath string) (func(), err // At this point we know the plugin is ready and we can fingerprint it // to get its vendor name and version client, err := csi.NewClient(socketPath, h.logger.Named("csi_client").With("plugin.name", h.task.CSIPluginConfig.ID, "plugin.type", h.task.CSIPluginConfig.Type)) - defer client.Close() if err != nil { return nil, fmt.Errorf("failed to create csi client: %v", err) } + defer client.Close() info, err := client.PluginInfo() if err != nil {