Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Nomad
Commits
7642d434
Commit
7642d434
authored
5 years ago
by
Lang Martin
Browse files
Options
Download
Email Patches
Plain Diff
csi: pluginmanager use PluginID instead of Driver
parent
0c469428
Branches unavailable
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
client/pluginmanager/csimanager/interface.go
+2
-2
client/pluginmanager/csimanager/interface.go
client/pluginmanager/csimanager/manager.go
+4
-4
client/pluginmanager/csimanager/manager.go
with
6 additions
and
6 deletions
+6
-6
client/pluginmanager/csimanager/interface.go
+
2
-
2
View file @
7642d434
...
...
@@ -9,7 +9,7 @@ import (
)
var
(
Driver
NotFoundErr
=
errors
.
New
(
"
Driver
not found"
)
Plugin
NotFoundErr
=
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
Driver
NotFoundErr
// If there is no plugin registered for this volume type, a
Plugin
NotFoundErr
// will be returned.
MounterForVolume
(
ctx
context
.
Context
,
volume
*
structs
.
CSIVolume
)
(
VolumeMounter
,
error
)
...
...
This diff is collapsed.
Click to expand it.
client/pluginmanager/csimanager/manager.go
+
4
-
4
View file @
7642d434
...
...
@@ -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
,
Driver
NotFoundErr
return
nil
,
Plugin
NotFoundErr
}
mgr
,
has
Driver
:=
nodePlugins
[
vol
.
Driver
]
if
!
has
Driver
{
return
nil
,
Driver
NotFoundErr
mgr
,
has
Plugin
:=
nodePlugins
[
vol
.
PluginID
]
if
!
has
Plugin
{
return
nil
,
Plugin
NotFoundErr
}
return
mgr
.
VolumeMounter
(
ctx
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help