diff --git a/pkg/volume/hostpath/host_path_test.go b/pkg/volume/hostpath/host_path_test.go index ec218977900..6f9fc42c42e 100644 --- a/pkg/volume/hostpath/host_path_test.go +++ b/pkg/volume/hostpath/host_path_test.go @@ -159,9 +159,7 @@ func TestProvisioner(t *testing.T) { plugMgr.InitPlugins(ProbeVolumePlugins(volume.VolumeConfig{ProvisioningEnabled: true}), nil, volumetest.NewFakeKubeletVolumeHost(t, "/tmp/fake", nil, nil)) - spec := &volume.Spec{PersistentVolume: &v1.PersistentVolume{Spec: v1.PersistentVolumeSpec{ - PersistentVolumeSource: v1.PersistentVolumeSource{HostPath: &v1.HostPathVolumeSource{Path: fmt.Sprintf("/tmp/hostpath.%s", uuid.NewUUID())}}}}} - plug, err := plugMgr.FindCreatablePluginBySpec(spec) + plug, err := plugMgr.FindProvisionablePluginByName(hostPathPluginName) if err != nil { t.Fatalf("Can't find the plugin by name") } diff --git a/pkg/volume/local/local_test.go b/pkg/volume/local/local_test.go index 8d549ae7c15..f24d1ac6271 100644 --- a/pkg/volume/local/local_test.go +++ b/pkg/volume/local/local_test.go @@ -720,11 +720,6 @@ func TestUnsupportedPlugins(t *testing.T) { t.Errorf("Attachable plugin found, expected none") } - createPlug, err := plugMgr.FindCreatablePluginBySpec(spec) - if err == nil && createPlug != nil { - t.Errorf("Creatable plugin found, expected none") - } - provisionPlug, err := plugMgr.FindProvisionablePluginByName(localVolumePluginName) if err == nil && provisionPlug != nil { t.Errorf("Provisionable plugin found, expected none") diff --git a/pkg/volume/plugins.go b/pkg/volume/plugins.go index 4152bffb43b..724a4d1c4ec 100644 --- a/pkg/volume/plugins.go +++ b/pkg/volume/plugins.go @@ -791,19 +791,6 @@ func (pm *VolumePluginMgr) FindDeletablePluginByName(name string) (DeletableVolu return nil, fmt.Errorf("no deletable volume plugin matched") } -// FindCreatablePluginBySpec fetches a persistent volume plugin by name. If -// no plugin is found, returns error. -func (pm *VolumePluginMgr) FindCreatablePluginBySpec(spec *Spec) (ProvisionableVolumePlugin, error) { - volumePlugin, err := pm.FindPluginBySpec(spec) - if err != nil { - return nil, err - } - if provisionableVolumePlugin, ok := volumePlugin.(ProvisionableVolumePlugin); ok { - return provisionableVolumePlugin, nil - } - return nil, fmt.Errorf("no creatable volume plugin matched") -} - // FindAttachablePluginBySpec fetches a persistent volume plugin by spec. // Unlike the other "FindPlugin" methods, this does not return error if no // plugin is found. All volumes require a mounter and unmounter, but not