mirror of https://github.com/k3s-io/k3s
fixed missing PV check in CanSupport
parent
77c39edcc9
commit
63ddfa537e
|
@ -53,9 +53,11 @@ func (plugin *ISCSIPlugin) Name() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (plugin *ISCSIPlugin) CanSupport(spec *volume.Spec) bool {
|
func (plugin *ISCSIPlugin) CanSupport(spec *volume.Spec) bool {
|
||||||
if spec.VolumeSource.ISCSI == nil {
|
if spec.VolumeSource.ISCSI == nil && spec.PersistentVolumeSource.ISCSI == nil {
|
||||||
return false
|
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
|
// see if iscsiadm is there
|
||||||
_, err := plugin.execCommand("iscsiadm", []string{"-h"})
|
_, err := plugin.execCommand("iscsiadm", []string{"-h"})
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
|
|
@ -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 {
|
for _, m := range modes {
|
||||||
if m == mode {
|
if m == mode {
|
||||||
return true
|
return true
|
||||||
|
|
Loading…
Reference in New Issue