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
0bbba1c3
Commit
0bbba1c3
authored
May 27, 2015
by
Tim Hockin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8732 from markturansky/missing_pv_support
Fixed CanSupport func across all volumes (for PV)
parents
a15c6979
3ad583cf
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
1 deletion
+19
-1
aws_ebs_test.go
pkg/volume/aws_ebs/aws_ebs_test.go
+3
-0
gce_pd_test.go
pkg/volume/gce_pd/gce_pd_test.go
+3
-0
glusterfs_test.go
pkg/volume/glusterfs/glusterfs_test.go
+3
-0
host_path_test.go
pkg/volume/host_path/host_path_test.go
+3
-0
iscsi_test.go
pkg/volume/iscsi/iscsi_test.go
+3
-0
rbd.go
pkg/volume/rbd/rbd.go
+1
-1
rbd_test.go
pkg/volume/rbd/rbd_test.go
+3
-0
No files found.
pkg/volume/aws_ebs/aws_ebs_test.go
View file @
0bbba1c3
...
...
@@ -40,6 +40,9 @@ func TestCanSupport(t *testing.T) {
if
!
plug
.
CanSupport
(
&
volume
.
Spec
{
Name
:
"foo"
,
VolumeSource
:
api
.
VolumeSource
{
AWSElasticBlockStore
:
&
api
.
AWSElasticBlockStoreVolumeSource
{}}})
{
t
.
Errorf
(
"Expected true"
)
}
if
!
plug
.
CanSupport
(
&
volume
.
Spec
{
Name
:
"foo"
,
PersistentVolumeSource
:
api
.
PersistentVolumeSource
{
AWSElasticBlockStore
:
&
api
.
AWSElasticBlockStoreVolumeSource
{}}})
{
t
.
Errorf
(
"Expected true"
)
}
}
func
TestGetAccessModes
(
t
*
testing
.
T
)
{
...
...
pkg/volume/gce_pd/gce_pd_test.go
View file @
0bbba1c3
...
...
@@ -40,6 +40,9 @@ func TestCanSupport(t *testing.T) {
if
!
plug
.
CanSupport
(
&
volume
.
Spec
{
Name
:
"foo"
,
VolumeSource
:
api
.
VolumeSource
{
GCEPersistentDisk
:
&
api
.
GCEPersistentDiskVolumeSource
{}}})
{
t
.
Errorf
(
"Expected true"
)
}
if
!
plug
.
CanSupport
(
&
volume
.
Spec
{
Name
:
"foo"
,
PersistentVolumeSource
:
api
.
PersistentVolumeSource
{
GCEPersistentDisk
:
&
api
.
GCEPersistentDiskVolumeSource
{}}})
{
t
.
Errorf
(
"Expected true"
)
}
}
func
TestGetAccessModes
(
t
*
testing
.
T
)
{
...
...
pkg/volume/glusterfs/glusterfs_test.go
View file @
0bbba1c3
...
...
@@ -40,6 +40,9 @@ func TestCanSupport(t *testing.T) {
if
!
plug
.
CanSupport
(
&
volume
.
Spec
{
Name
:
"foo"
,
VolumeSource
:
api
.
VolumeSource
{
Glusterfs
:
&
api
.
GlusterfsVolumeSource
{}}})
{
t
.
Errorf
(
"Expected true"
)
}
if
!
plug
.
CanSupport
(
&
volume
.
Spec
{
Name
:
"foo"
,
PersistentVolumeSource
:
api
.
PersistentVolumeSource
{
Glusterfs
:
&
api
.
GlusterfsVolumeSource
{}}})
{
t
.
Errorf
(
"Expected true"
)
}
if
plug
.
CanSupport
(
&
volume
.
Spec
{
Name
:
"foo"
,
VolumeSource
:
api
.
VolumeSource
{}})
{
t
.
Errorf
(
"Expected false"
)
}
...
...
pkg/volume/host_path/host_path_test.go
View file @
0bbba1c3
...
...
@@ -38,6 +38,9 @@ func TestCanSupport(t *testing.T) {
if
!
plug
.
CanSupport
(
&
volume
.
Spec
{
Name
:
"foo"
,
VolumeSource
:
api
.
VolumeSource
{
HostPath
:
&
api
.
HostPathVolumeSource
{}}})
{
t
.
Errorf
(
"Expected true"
)
}
if
!
plug
.
CanSupport
(
&
volume
.
Spec
{
Name
:
"foo"
,
PersistentVolumeSource
:
api
.
PersistentVolumeSource
{
HostPath
:
&
api
.
HostPathVolumeSource
{}}})
{
t
.
Errorf
(
"Expected true"
)
}
if
plug
.
CanSupport
(
&
volume
.
Spec
{
Name
:
"foo"
,
VolumeSource
:
api
.
VolumeSource
{}})
{
t
.
Errorf
(
"Expected false"
)
}
...
...
pkg/volume/iscsi/iscsi_test.go
View file @
0bbba1c3
...
...
@@ -37,6 +37,9 @@ func TestCanSupport(t *testing.T) {
if
plug
.
Name
()
!=
"kubernetes.io/iscsi"
{
t
.
Errorf
(
"Wrong name: %s"
,
plug
.
Name
())
}
if
plug
.
CanSupport
(
&
volume
.
Spec
{
Name
:
"foo"
,
VolumeSource
:
api
.
VolumeSource
{}})
{
t
.
Errorf
(
"Expected false"
)
}
}
func
TestGetAccessModes
(
t
*
testing
.
T
)
{
...
...
pkg/volume/rbd/rbd.go
View file @
0bbba1c3
...
...
@@ -53,7 +53,7 @@ func (plugin *RBDPlugin) Name() string {
}
func
(
plugin
*
RBDPlugin
)
CanSupport
(
spec
*
volume
.
Spec
)
bool
{
if
spec
.
VolumeSource
.
RBD
==
nil
{
if
spec
.
VolumeSource
.
RBD
==
nil
&&
spec
.
PersistentVolumeSource
.
RBD
==
nil
{
return
false
}
// see if rbd is there
...
...
pkg/volume/rbd/rbd_test.go
View file @
0bbba1c3
...
...
@@ -37,6 +37,9 @@ func TestCanSupport(t *testing.T) {
if
plug
.
Name
()
!=
"kubernetes.io/rbd"
{
t
.
Errorf
(
"Wrong name: %s"
,
plug
.
Name
())
}
if
plug
.
CanSupport
(
&
volume
.
Spec
{
Name
:
"foo"
,
VolumeSource
:
api
.
VolumeSource
{}})
{
t
.
Errorf
(
"Expected false"
)
}
}
type
fakeDiskManager
struct
{}
...
...
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