Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
74051595
Commit
74051595
authored
Dec 01, 2017
by
Vladimir Vivien
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VolumeHost.GetNodeName method added for CSI fix
parent
8c1ee761
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
0 deletions
+30
-0
attach_detach_controller.go
...ontroller/volume/attachdetach/attach_detach_controller.go
+4
-0
expand_controller.go
pkg/controller/volume/expand/expand_controller.go
+4
-0
volume_host.go
pkg/controller/volume/persistentvolume/volume_host.go
+4
-0
volume_host.go
pkg/kubelet/volume_host.go
+4
-0
plugins.go
pkg/volume/plugins.go
+3
-0
testing.go
pkg/volume/testing/testing.go
+11
-0
No files found.
pkg/controller/volume/attachdetach/attach_detach_controller.go
View file @
74051595
...
...
@@ -603,3 +603,7 @@ func (adc *attachDetachController) addNodeToDswp(node *v1.Node, nodeName types.N
func
(
adc
*
attachDetachController
)
GetNodeLabels
()
(
map
[
string
]
string
,
error
)
{
return
nil
,
fmt
.
Errorf
(
"GetNodeLabels() unsupported in Attach/Detach controller"
)
}
func
(
adc
*
attachDetachController
)
GetNodeName
()
types
.
NodeName
{
return
""
}
pkg/controller/volume/expand/expand_controller.go
View file @
74051595
...
...
@@ -277,3 +277,7 @@ func (expc *expandController) GetConfigMapFunc() func(namespace, name string) (*
func
(
expc
*
expandController
)
GetNodeLabels
()
(
map
[
string
]
string
,
error
)
{
return
nil
,
fmt
.
Errorf
(
"GetNodeLabels unsupported in expandController"
)
}
func
(
expc
*
expandController
)
GetNodeName
()
types
.
NodeName
{
return
""
}
pkg/controller/volume/persistentvolume/volume_host.go
View file @
74051595
...
...
@@ -108,3 +108,7 @@ func (adc *PersistentVolumeController) GetExec(pluginName string) mount.Exec {
func
(
ctrl
*
PersistentVolumeController
)
GetNodeLabels
()
(
map
[
string
]
string
,
error
)
{
return
nil
,
fmt
.
Errorf
(
"GetNodeLabels() unsupported in PersistentVolumeController"
)
}
func
(
ctrl
*
PersistentVolumeController
)
GetNodeName
()
types
.
NodeName
{
return
""
}
pkg/kubelet/volume_host.go
View file @
74051595
...
...
@@ -188,6 +188,10 @@ func (kvh *kubeletVolumeHost) GetNodeLabels() (map[string]string, error) {
return
node
.
Labels
,
nil
}
func
(
kvh
*
kubeletVolumeHost
)
GetNodeName
()
types
.
NodeName
{
return
kvh
.
kubelet
.
nodeName
}
func
(
kvh
*
kubeletVolumeHost
)
GetExec
(
pluginName
string
)
mount
.
Exec
{
exec
,
err
:=
kvh
.
getMountExec
(
pluginName
)
if
err
!=
nil
{
...
...
pkg/volume/plugins.go
View file @
74051595
...
...
@@ -303,6 +303,9 @@ type VolumeHost interface {
// Returns the labels on the node
GetNodeLabels
()
(
map
[
string
]
string
,
error
)
// Returns the name of the node
GetNodeName
()
types
.
NodeName
}
// VolumePluginMgr tracks registered plugins.
...
...
pkg/volume/testing/testing.go
View file @
74051595
...
...
@@ -53,6 +53,7 @@ type fakeVolumeHost struct {
exec
mount
.
Exec
writer
io
.
Writer
nodeLabels
map
[
string
]
string
nodeName
string
}
func
NewFakeVolumeHost
(
rootDir
string
,
kubeClient
clientset
.
Interface
,
plugins
[]
VolumePlugin
)
*
fakeVolumeHost
{
...
...
@@ -69,6 +70,12 @@ func NewFakeVolumeHostWithNodeLabels(rootDir string, kubeClient clientset.Interf
return
volHost
}
func
NewFakeVolumeHostWithNodeName
(
rootDir
string
,
kubeClient
clientset
.
Interface
,
plugins
[]
VolumePlugin
,
nodeName
string
)
*
fakeVolumeHost
{
volHost
:=
newFakeVolumeHost
(
rootDir
,
kubeClient
,
plugins
,
nil
)
volHost
.
nodeName
=
nodeName
return
volHost
}
func
newFakeVolumeHost
(
rootDir
string
,
kubeClient
clientset
.
Interface
,
plugins
[]
VolumePlugin
,
cloud
cloudprovider
.
Interface
)
*
fakeVolumeHost
{
host
:=
&
fakeVolumeHost
{
rootDir
:
rootDir
,
kubeClient
:
kubeClient
,
cloud
:
cloud
}
host
.
mounter
=
&
mount
.
FakeMounter
{}
...
...
@@ -177,6 +184,10 @@ func (f *fakeVolumeHost) GetNodeLabels() (map[string]string, error) {
return
f
.
nodeLabels
,
nil
}
func
(
f
*
fakeVolumeHost
)
GetNodeName
()
types
.
NodeName
{
return
types
.
NodeName
(
f
.
nodeName
)
}
func
ProbeVolumePlugins
(
config
VolumeConfig
)
[]
VolumePlugin
{
if
_
,
ok
:=
config
.
OtherAttributes
[
"fake-property"
];
ok
{
return
[]
VolumePlugin
{
...
...
Write
Preview
Markdown
is supported
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