mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 02:09:56 +00:00
Merge pull request #8688 from markturansky/nfs_missing_pv
Fixed NFS CanSupport func for PVs
This commit is contained in:
commit
8e25670c07
@ -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