From 3f5039a2d19e5a2b6c176f780ae96018d883051e Mon Sep 17 00:00:00 2001 From: Renaud Gaubert Date: Thu, 8 Nov 2018 20:10:08 +0000 Subject: [PATCH] Fix pluginwatcher panic on failed startup --- pkg/kubelet/util/pluginwatcher/plugin_watcher.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/kubelet/util/pluginwatcher/plugin_watcher.go b/pkg/kubelet/util/pluginwatcher/plugin_watcher.go index de2addd2846..871daebc7db 100644 --- a/pkg/kubelet/util/pluginwatcher/plugin_watcher.go +++ b/pkg/kubelet/util/pluginwatcher/plugin_watcher.go @@ -187,7 +187,9 @@ func (w *Watcher) traversePluginDir(dir string) error { return fmt.Errorf("failed to watch %s, err: %v", path, err) } case mode&os.ModeSocket != 0: + w.wg.Add(1) go func() { + defer w.wg.Done() w.fsWatcher.Events <- fsnotify.Event{ Name: path, Op: fsnotify.Create,