mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #99723 from jingxu97/feb/statl
Fix issue in checking domain socket for plugin watcher
This commit is contained in:
commit
4f9317596c
@ -159,7 +159,13 @@ func (w *Watcher) traversePluginDir(dir string) error {
|
||||
func (w *Watcher) handleCreateEvent(event fsnotify.Event) error {
|
||||
klog.V(6).Infof("Handling create event: %v", event)
|
||||
|
||||
fi, err := os.Lstat(event.Name)
|
||||
fi, err := os.Stat(event.Name)
|
||||
// TODO: This is a workaround for Windows 20H2 issue for os.Stat(). Please see
|
||||
// microsoft/Windows-Containers#97 for details.
|
||||
// Once the issue is resvolved, the following os.Lstat() is not needed.
|
||||
if err != nil && runtime.GOOS == "windows" {
|
||||
fi, err = os.Lstat(event.Name)
|
||||
}
|
||||
if err != nil {
|
||||
return fmt.Errorf("stat file %s failed: %v", event.Name, err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user