kubelet: upgrade sourceFile to use fsnotify
Mitigate some flakes for deleted watch directories and use the maintained fsnotify package.
This commit is contained in:
@@ -22,7 +22,6 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"sync"
|
||||
"testing"
|
||||
@@ -428,7 +427,7 @@ func writeFile(filename string, data []byte) error {
|
||||
func changeFileName(dir, from, to string, t *testing.T) {
|
||||
fromPath := filepath.Join(dir, from)
|
||||
toPath := filepath.Join(dir, to)
|
||||
if err := exec.Command("mv", fromPath, toPath).Run(); err != nil {
|
||||
if err := os.Rename(fromPath, toPath); err != nil {
|
||||
t.Errorf("Fail to change file name: %s", err)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user