From 5c26cdf08bb1fd9d55b032a18ae98ebd9191086b Mon Sep 17 00:00:00 2001 From: Lang Martin Date: Tue, 28 Jan 2020 11:27:32 -0500 Subject: [PATCH] csi: pluginmanager use PluginID instead of Driver --- client/pluginmanager/csimanager/interface.go | 4 ++-- client/pluginmanager/csimanager/manager.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client/pluginmanager/csimanager/interface.go b/client/pluginmanager/csimanager/interface.go index 4944bb2a3..c266e2842 100644 --- a/client/pluginmanager/csimanager/interface.go +++ b/client/pluginmanager/csimanager/interface.go @@ -9,7 +9,7 @@ import ( ) var ( - DriverNotFoundErr = errors.New("Driver not found") + PluginNotFoundErr = errors.New("Plugin not found") ) type MountInfo struct { @@ -25,7 +25,7 @@ type Manager interface { PluginManager() pluginmanager.PluginManager // MounterForVolume returns a VolumeMounter for the given requested volume. - // If there is no plugin registered for this volume type, a DriverNotFoundErr + // If there is no plugin registered for this volume type, a PluginNotFoundErr // will be returned. MounterForVolume(ctx context.Context, volume *structs.CSIVolume) (VolumeMounter, error) diff --git a/client/pluginmanager/csimanager/manager.go b/client/pluginmanager/csimanager/manager.go index b32caed75..9f932e384 100644 --- a/client/pluginmanager/csimanager/manager.go +++ b/client/pluginmanager/csimanager/manager.go @@ -72,12 +72,12 @@ func (c *csiManager) PluginManager() pluginmanager.PluginManager { func (c *csiManager) MounterForVolume(ctx context.Context, vol *structs.CSIVolume) (VolumeMounter, error) { nodePlugins, hasAnyNodePlugins := c.instances["csi-node"] if !hasAnyNodePlugins { - return nil, DriverNotFoundErr + return nil, PluginNotFoundErr } - mgr, hasDriver := nodePlugins[vol.Driver] - if !hasDriver { - return nil, DriverNotFoundErr + mgr, hasPlugin := nodePlugins[vol.PluginID] + if !hasPlugin { + return nil, PluginNotFoundErr } return mgr.VolumeMounter(ctx)