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
130bb035
Commit
130bb035
authored
Aug 10, 2017
by
Vladimir Vivien
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Specify node labels for fakeVolumeHost when testing
parent
eb700d86
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
testing.go
pkg/volume/testing/testing.go
+11
-1
No files found.
pkg/volume/testing/testing.go
View file @
130bb035
...
...
@@ -50,6 +50,7 @@ type fakeVolumeHost struct {
cloud
cloudprovider
.
Interface
mounter
mount
.
Interface
writer
io
.
Writer
nodeLabels
map
[
string
]
string
}
func
NewFakeVolumeHost
(
rootDir
string
,
kubeClient
clientset
.
Interface
,
plugins
[]
VolumePlugin
)
*
fakeVolumeHost
{
...
...
@@ -60,6 +61,12 @@ func NewFakeVolumeHostWithCloudProvider(rootDir string, kubeClient clientset.Int
return
newFakeVolumeHost
(
rootDir
,
kubeClient
,
plugins
,
cloud
)
}
func
NewFakeVolumeHostWithNodeLabels
(
rootDir
string
,
kubeClient
clientset
.
Interface
,
plugins
[]
VolumePlugin
,
labels
map
[
string
]
string
)
*
fakeVolumeHost
{
volHost
:=
newFakeVolumeHost
(
rootDir
,
kubeClient
,
plugins
,
nil
)
volHost
.
nodeLabels
=
labels
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
{}
...
...
@@ -149,7 +156,10 @@ func (f *fakeVolumeHost) GetConfigMapFunc() func(namespace, name string) (*v1.Co
}
func
(
f
*
fakeVolumeHost
)
GetNodeLabels
()
(
map
[
string
]
string
,
error
)
{
return
map
[
string
]
string
{
"test-label"
:
"test-value"
},
nil
if
f
.
nodeLabels
==
nil
{
f
.
nodeLabels
=
map
[
string
]
string
{
"test-label"
:
"test-value"
}
}
return
f
.
nodeLabels
,
nil
}
func
ProbeVolumePlugins
(
config
VolumeConfig
)
[]
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