mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #77537 from cwdsuzhou/use_key_in_lugins
Use key in probedPlugin
This commit is contained in:
commit
c2966f7c29
@ -657,9 +657,9 @@ func (pm *VolumePluginMgr) FindPluginBySpec(spec *Spec) (VolumePlugin, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pm.refreshProbedPlugins()
|
pm.refreshProbedPlugins()
|
||||||
for _, plugin := range pm.probedPlugins {
|
for pluginName, plugin := range pm.probedPlugins {
|
||||||
if plugin.CanSupport(spec) {
|
if plugin.CanSupport(spec) {
|
||||||
matchedPluginNames = append(matchedPluginNames, plugin.GetPluginName())
|
matchedPluginNames = append(matchedPluginNames, pluginName)
|
||||||
matches = append(matches, plugin)
|
matches = append(matches, plugin)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -713,19 +713,15 @@ func (pm *VolumePluginMgr) FindPluginByName(name string) (VolumePlugin, error) {
|
|||||||
// Once we can get rid of legacy names we can reduce this to a map lookup.
|
// Once we can get rid of legacy names we can reduce this to a map lookup.
|
||||||
matchedPluginNames := []string{}
|
matchedPluginNames := []string{}
|
||||||
matches := []VolumePlugin{}
|
matches := []VolumePlugin{}
|
||||||
for k, v := range pm.plugins {
|
if v, found := pm.plugins[name]; found {
|
||||||
if v.GetPluginName() == name {
|
matchedPluginNames = append(matchedPluginNames, name)
|
||||||
matchedPluginNames = append(matchedPluginNames, k)
|
matches = append(matches, v)
|
||||||
matches = append(matches, v)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pm.refreshProbedPlugins()
|
pm.refreshProbedPlugins()
|
||||||
for _, plugin := range pm.probedPlugins {
|
if plugin, found := pm.probedPlugins[name]; found {
|
||||||
if plugin.GetPluginName() == name {
|
matchedPluginNames = append(matchedPluginNames, name)
|
||||||
matchedPluginNames = append(matchedPluginNames, plugin.GetPluginName())
|
matches = append(matches, plugin)
|
||||||
matches = append(matches, plugin)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(matches) == 0 {
|
if len(matches) == 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user