mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Fix invalid filename in kubelet log
Fixes: https://github.com/kubernetes/kubernetes/issues/47641
This commit is contained in:
		@@ -23,6 +23,7 @@ import (
 | 
				
			|||||||
	"os"
 | 
						"os"
 | 
				
			||||||
	"path/filepath"
 | 
						"path/filepath"
 | 
				
			||||||
	"sort"
 | 
						"sort"
 | 
				
			||||||
 | 
						"strings"
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/golang/glog"
 | 
						"github.com/golang/glog"
 | 
				
			||||||
@@ -44,6 +45,9 @@ type sourceFile struct {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func NewSourceFile(path string, nodeName types.NodeName, period time.Duration, updates chan<- interface{}) {
 | 
					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)
 | 
						config := new(path, nodeName, period, updates)
 | 
				
			||||||
	glog.V(1).Infof("Watching path %q", path)
 | 
						glog.V(1).Infof("Watching path %q", path)
 | 
				
			||||||
	go wait.Forever(config.run, period)
 | 
						go wait.Forever(config.run, period)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user