Fixed issue in plugin.go for bug #106696

Fixed issue in plugin.go where valid plugin events would be skipped if any plugin had an error. This meant that valid plugins would never be installed if another was in an error state as the events fired only once.
This commit is contained in:
Scott Nice 2021-11-27 15:07:19 -05:00 committed by GitHub
parent 9a75e7b0fd
commit 1070eb7428
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -746,11 +746,10 @@ func (pm *VolumePluginMgr) logDeprecation(plugin string) {
// If it is, initialize all probed plugins and replace the cache with them.
func (pm *VolumePluginMgr) refreshProbedPlugins() {
events, err := pm.prober.Probe()
if err != nil {
klog.ErrorS(err, "Error dynamically probing plugins")
return // Use cached plugins upon failure.
}
// because the probe function can return a list of valid plugins
// even when an error is present we still must add the plugins
// or they will be skipped because each event only fires once
for _, event := range events {
if event.Op == ProbeAddOrUpdate {
if err := pm.initProbedPlugin(event.Plugin); err != nil {
@ -767,6 +766,11 @@ func (pm *VolumePluginMgr) refreshProbedPlugins() {
"pluginName", event.Plugin.GetPluginName())
}
}
if err != nil {
klog.ErrorS(err, "Error dynamically probing plugins")
return
}
}
// ListVolumePluginWithLimits returns plugins that have volume limits on nodes