From 11fef8ba3bae7a3b06f1c4aa4214fb94e3d11987 Mon Sep 17 00:00:00 2001 From: Renaud Gaubert Date: Thu, 8 Nov 2018 23:42:02 +0000 Subject: [PATCH] Pluginwatcher should prevent kubelet from starting if we cannot watch the plugin root --- pkg/kubelet/util/pluginwatcher/plugin_watcher.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/kubelet/util/pluginwatcher/plugin_watcher.go b/pkg/kubelet/util/pluginwatcher/plugin_watcher.go index 26ebc80bed6..88dda9b7c02 100644 --- a/pkg/kubelet/util/pluginwatcher/plugin_watcher.go +++ b/pkg/kubelet/util/pluginwatcher/plugin_watcher.go @@ -176,9 +176,14 @@ func (w *Watcher) init() error { // Walks through the plugin directory discover any existing plugin sockets. // Goroutines started here will be waited for in Stop() before cleaning up. +// Ignore all errors except root dir not being walkable func (w *Watcher) traversePluginDir(dir string) error { return w.fs.Walk(dir, func(path string, info os.FileInfo, err error) error { if err != nil { + if path == dir { + return fmt.Errorf("error accessing path: %s error: %v", path, err) + } + glog.Errorf("error accessing path: %s error: %v", path, err) return nil }