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
8042411f
Unverified
Commit
8042411f
authored
Oct 10, 2018
by
k8s-ci-robot
Committed by
GitHub
Oct 10, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #65296 from lichuqiang/povision_inter_test
Add volume topology-aware dynamic provisioning related integration case
parents
77742ea9
db775814
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
testing.go
pkg/volume/testing/testing.go
+10
-0
volume_binding_test.go
test/integration/scheduler/volume_binding_test.go
+0
-0
No files found.
pkg/volume/testing/testing.go
View file @
8042411f
...
@@ -46,6 +46,10 @@ import (
...
@@ -46,6 +46,10 @@ import (
"k8s.io/kubernetes/pkg/volume/util/volumepathhandler"
"k8s.io/kubernetes/pkg/volume/util/volumepathhandler"
)
)
// A hook specified in storage class to indicate it's provisioning
// is expected to fail.
const
ExpectProvisionFailureKey
=
"expect-provision-failure"
// fakeVolumeHost is useful for testing volume plugins.
// fakeVolumeHost is useful for testing volume plugins.
type
fakeVolumeHost
struct
{
type
fakeVolumeHost
struct
{
rootDir
string
rootDir
string
...
@@ -787,6 +791,12 @@ type FakeProvisioner struct {
...
@@ -787,6 +791,12 @@ type FakeProvisioner struct {
}
}
func
(
fc
*
FakeProvisioner
)
Provision
(
selectedNode
*
v1
.
Node
,
allowedTopologies
[]
v1
.
TopologySelectorTerm
)
(
*
v1
.
PersistentVolume
,
error
)
{
func
(
fc
*
FakeProvisioner
)
Provision
(
selectedNode
*
v1
.
Node
,
allowedTopologies
[]
v1
.
TopologySelectorTerm
)
(
*
v1
.
PersistentVolume
,
error
)
{
// Add provision failure hook
if
fc
.
Options
.
Parameters
!=
nil
{
if
_
,
ok
:=
fc
.
Options
.
Parameters
[
ExpectProvisionFailureKey
];
ok
{
return
nil
,
fmt
.
Errorf
(
"expected error"
)
}
}
fullpath
:=
fmt
.
Sprintf
(
"/tmp/hostpath_pv/%s"
,
uuid
.
NewUUID
())
fullpath
:=
fmt
.
Sprintf
(
"/tmp/hostpath_pv/%s"
,
uuid
.
NewUUID
())
pv
:=
&
v1
.
PersistentVolume
{
pv
:=
&
v1
.
PersistentVolume
{
...
...
test/integration/scheduler/volume_binding_test.go
View file @
8042411f
This diff is collapsed.
Click to expand it.
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