fixed missing PV check in CanSupport

pull/6/head
markturansky 2015-05-22 15:23:34 -04:00
parent 77c39edcc9
commit 63ddfa537e
2 changed files with 4 additions and 2 deletions

View File

@ -53,9 +53,11 @@ func (plugin *ISCSIPlugin) Name() string {
}
func (plugin *ISCSIPlugin) CanSupport(spec *volume.Spec) bool {
if spec.VolumeSource.ISCSI == nil {
if spec.VolumeSource.ISCSI == nil && spec.PersistentVolumeSource.ISCSI == nil {
return false
}
// TODO: turn this into a func so CanSupport can be unit tested without
// having to make system calls
// see if iscsiadm is there
_, err := plugin.execCommand("iscsiadm", []string{"-h"})
if err == nil {

View File

@ -52,7 +52,7 @@ func TestGetAccessModes(t *testing.T) {
}
}
func contains(modes []api.AccessModeType, mode api.AccessModeType) bool {
func contains(modes []api.PersistentVolumeAccessMode, mode api.PersistentVolumeAccessMode) bool {
for _, m := range modes {
if m == mode {
return true