From 4ee6b42a4d26d79f7d2694d95963fcd5b32b3369 Mon Sep 17 00:00:00 2001 From: Cao Shufeng Date: Fri, 16 Jun 2017 17:57:07 +0800 Subject: [PATCH] Fix invalid filename in kubelet log Fixes: https://github.com/kubernetes/kubernetes/issues/47641 --- pkg/kubelet/config/file.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/kubelet/config/file.go b/pkg/kubelet/config/file.go index 421d19fa992..cb4ae650e5c 100644 --- a/pkg/kubelet/config/file.go +++ b/pkg/kubelet/config/file.go @@ -23,6 +23,7 @@ import ( "os" "path/filepath" "sort" + "strings" "time" "github.com/golang/glog" @@ -44,6 +45,9 @@ type sourceFile struct { } func NewSourceFile(path string, nodeName types.NodeName, period time.Duration, updates chan<- interface{}) { + // "golang.org/x/exp/inotify" requires a path without trailing "/" + path = strings.TrimRight(path, string(os.PathSeparator)) + config := new(path, nodeName, period, updates) glog.V(1).Infof("Watching path %q", path) go wait.Forever(config.run, period)