Skip to content

Commit

Permalink
Merge pull request #99723 from jingxu97/feb/statl
Browse files Browse the repository at this point in the history
 Fix issue in checking domain socket for plugin watcher
  • Loading branch information
k8s-ci-robot committed Mar 4, 2021
2 parents afb1ee3 + d669cb1 commit 4f93175
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/kubelet/pluginmanager/pluginwatcher/plugin_watcher.go
Expand Up @@ -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)
}
Expand Down

0 comments on commit 4f93175

Please sign in to comment.