From 2fe823ba46a50c4d0e49fbddfd96a86c809be5c8 Mon Sep 17 00:00:00 2001 From: caiweidong Date: Tue, 23 Apr 2019 20:59:10 +0800 Subject: [PATCH] fix: use locked func to replace the raw one to avoid concurrent read --- pkg/kubelet/util/pluginwatcher/plugin_watcher.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/kubelet/util/pluginwatcher/plugin_watcher.go b/pkg/kubelet/util/pluginwatcher/plugin_watcher.go index a9f8422edf0..fbe8aa69d4a 100644 --- a/pkg/kubelet/util/pluginwatcher/plugin_watcher.go +++ b/pkg/kubelet/util/pluginwatcher/plugin_watcher.go @@ -275,7 +275,7 @@ func (w *Watcher) handlePluginRegistration(socketPath string) error { return fmt.Errorf("failed to get plugin info using RPC GetInfo at socket %s, err: %v", socketPath, err) } - handler, ok := w.handlers[infoResp.Type] + handler, ok := w.getHandler(infoResp.Type) if !ok { return w.notifyPlugin(client, false, fmt.Sprintf("no handler registered for plugin type: %s at socket %s", infoResp.Type, socketPath)) }