mirror of https://github.com/k3s-io/k3s
Merge pull request #8688 from markturansky/nfs_missing_pv
Fixed NFS CanSupport func for PVspull/6/head
commit
8e25670c07
|
@ -52,7 +52,7 @@ func (plugin *nfsPlugin) Name() string {
|
|||
}
|
||||
|
||||
func (plugin *nfsPlugin) CanSupport(spec *volume.Spec) bool {
|
||||
return spec.VolumeSource.NFS != nil
|
||||
return spec.VolumeSource.NFS != nil || spec.PersistentVolumeSource.NFS != nil
|
||||
}
|
||||
|
||||
func (plugin *nfsPlugin) GetAccessModes() []api.PersistentVolumeAccessMode {
|
||||
|
|
|
@ -39,6 +39,9 @@ func TestCanSupport(t *testing.T) {
|
|||
if !plug.CanSupport(&volume.Spec{Name: "foo", VolumeSource: api.VolumeSource{NFS: &api.NFSVolumeSource{}}}) {
|
||||
t.Errorf("Expected true")
|
||||
}
|
||||
if !plug.CanSupport(&volume.Spec{Name: "foo", PersistentVolumeSource: api.PersistentVolumeSource{NFS: &api.NFSVolumeSource{}}}) {
|
||||
t.Errorf("Expected true")
|
||||
}
|
||||
if plug.CanSupport(&volume.Spec{Name: "foo", VolumeSource: api.VolumeSource{}}) {
|
||||
t.Errorf("Expected false")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue