mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-15 23:03:40 +00:00
Added missing PV support to NFS
This commit is contained in:
parent
e0092a1c23
commit
4f88d418c8
@ -52,7 +52,7 @@ func (plugin *nfsPlugin) Name() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (plugin *nfsPlugin) CanSupport(spec *volume.Spec) bool {
|
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 {
|
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{}}}) {
|
if !plug.CanSupport(&volume.Spec{Name: "foo", VolumeSource: api.VolumeSource{NFS: &api.NFSVolumeSource{}}}) {
|
||||||
t.Errorf("Expected true")
|
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{}}) {
|
if plug.CanSupport(&volume.Spec{Name: "foo", VolumeSource: api.VolumeSource{}}) {
|
||||||
t.Errorf("Expected false")
|
t.Errorf("Expected false")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user