mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 15:58:37 +00:00
Merge pull request #124837 from carlory/rm-FindCreatablePluginBySpec
remove unused FindCreatablePluginBySpec
This commit is contained in:
commit
af71138323
@ -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")
|
||||
}
|
||||
|
@ -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")
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user