mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 03:03:59 +00:00
Revert "fix: handle socket file detection on Windows"
This reverts commit 4060ee60c1
.
This commit is contained in:
parent
620c9ed34d
commit
2454d8d4c3
@ -203,12 +203,15 @@ func (m *ManagerImpl) CleanupPluginDirectory(dir string) error {
|
|||||||
if filePath == m.checkpointFile() {
|
if filePath == m.checkpointFile() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
stat, err := os.Stat(filePath)
|
// TODO: Until the bug - https://github.com/golang/go/issues/33357 is fixed, os.stat wouldn't return the
|
||||||
|
// right mode(socket) on windows. Hence deleting the file, without checking whether
|
||||||
|
// its a socket, on windows.
|
||||||
|
stat, err := os.Lstat(filePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
klog.ErrorS(err, "Failed to stat file", "path", filePath)
|
klog.ErrorS(err, "Failed to stat file", "path", filePath)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if stat.IsDir() || stat.Mode()&os.ModeSocket == 0 {
|
if stat.IsDir() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
err = os.RemoveAll(filePath)
|
err = os.RemoveAll(filePath)
|
||||||
|
Loading…
Reference in New Issue
Block a user