mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
csi: pluginmanager use PluginID instead of Driver
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user