From 7fed6f9f47d8e5bfc7abc7b4b0b4f822a3b03f2d Mon Sep 17 00:00:00 2001 From: childsb Date: Tue, 23 Feb 2016 17:13:14 -0600 Subject: [PATCH] Remove host command sniffing from CanSupport(..) --- pkg/volume/fc/fc.go | 9 +-------- pkg/volume/iscsi/iscsi.go | 9 +-------- pkg/volume/rbd/rbd.go | 7 +------ 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/pkg/volume/fc/fc.go b/pkg/volume/fc/fc.go index 0c0fc1014d0..44e7c8218a7 100644 --- a/pkg/volume/fc/fc.go +++ b/pkg/volume/fc/fc.go @@ -59,15 +59,8 @@ func (plugin *fcPlugin) CanSupport(spec *volume.Spec) bool { if (spec.Volume != nil && spec.Volume.FC == nil) || (spec.PersistentVolume != nil && spec.PersistentVolume.Spec.FC == nil) { return false } - // TODO: turn this into a func so CanSupport can be unit tested without - // having to make system calls - // see if /sys/class/fc_transport is there, which indicates fc is connected - _, err := plugin.execCommand("ls", []string{"/sys/class/fc_transport"}) - if err == nil { - return true - } - return false + return true } func (plugin *fcPlugin) GetAccessModes() []api.PersistentVolumeAccessMode { diff --git a/pkg/volume/iscsi/iscsi.go b/pkg/volume/iscsi/iscsi.go index fe2f32ff13d..fa89b9664a2 100644 --- a/pkg/volume/iscsi/iscsi.go +++ b/pkg/volume/iscsi/iscsi.go @@ -59,15 +59,8 @@ func (plugin *iscsiPlugin) CanSupport(spec *volume.Spec) bool { if (spec.Volume != nil && spec.Volume.ISCSI == nil) || (spec.PersistentVolume != nil && spec.PersistentVolume.Spec.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 { - return true - } - return false + return true } func (plugin *iscsiPlugin) GetAccessModes() []api.PersistentVolumeAccessMode { diff --git a/pkg/volume/rbd/rbd.go b/pkg/volume/rbd/rbd.go index 5cb7cc11745..878688fa461 100644 --- a/pkg/volume/rbd/rbd.go +++ b/pkg/volume/rbd/rbd.go @@ -58,13 +58,8 @@ func (plugin *rbdPlugin) CanSupport(spec *volume.Spec) bool { if (spec.Volume != nil && spec.Volume.RBD == nil) || (spec.PersistentVolume != nil && spec.PersistentVolume.Spec.RBD == nil) { return false } - // see if rbd is there - _, err := plugin.execCommand("rbd", []string{"-h"}) - if err == nil { - return true - } - return false + return true } func (plugin *rbdPlugin) GetAccessModes() []api.PersistentVolumeAccessMode {