Skip to content

Commit

Permalink
Merge pull request #99745 from jingxu97/automated-cherry-pick-of-#99463-
Browse files Browse the repository at this point in the history
#99723-upstream-release-1.19

Automated cherry pick of #99463: Use Lstat in plugin watcher to avoid Windows problem #99723:  Fix issue in checking domain socket for plugin watcher
  • Loading branch information
k8s-ci-robot authored Mar 11, 2021
2 parents d7537d6 + 649159d commit 8b66415
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/kubelet/pluginmanager/pluginwatcher/plugin_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ func (w *Watcher) handleCreateEvent(event fsnotify.Event) error {
klog.V(6).Infof("Handling create event: %v", event)

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 8b66415

Please sign in to comment.