Skip to content

Commit b670d82

Browse files
alrstgross
authored andcommitted
client/allocrunner/taskrunner: client.Close after err check (#8825)
1 parent e8a418b commit b670d82

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

client/allocrunner/taskrunner/plugin_supervisor_hook.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,10 @@ func (h *csiPluginSupervisorHook) registerPlugin(socketPath string) (func(), err
260260
// At this point we know the plugin is ready and we can fingerprint it
261261
// to get its vendor name and version
262262
client, err := csi.NewClient(socketPath, h.logger.Named("csi_client").With("plugin.name", h.task.CSIPluginConfig.ID, "plugin.type", h.task.CSIPluginConfig.Type))
263-
defer client.Close()
264263
if err != nil {
265264
return nil, fmt.Errorf("failed to create csi client: %v", err)
266265
}
266+
defer client.Close()
267267

268268
info, err := client.PluginInfo()
269269
if err != nil {

0 commit comments

Comments
 (0)