Merge pull request #64880 from dixudx/manifest_file_not_found

Automatic merge from submit-queue (batch tested with PRs 58690, 64773, 64880, 64915, 64831). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

ignore not found file error when watching manifests

**What this PR does / why we need it**:
An alternative of #63910.

When using vim to create a new file in manifest folder, a temporary file, with an arbitrary number (like 4913) as its name, will be created to check if a directory is writable and see the resulting ACL.

These temporary files will be deleted later, which should by ignored when watching the manifest folder.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #55928, #59009, #48219

**Special notes for your reviewer**:
/cc dims luxas yujuhong liggitt tallclair

**Release note**:

```release-note
ignore not found file error when watching manifests
```
This commit is contained in:
Kubernetes Submit Queue 2018-06-20 14:21:17 -07:00 committed by GitHub
commit ce09da5653
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -179,7 +179,9 @@ func (s *sourceFile) extractFromDir(name string) ([]*v1.Pod, error) {
case statInfo.Mode().IsRegular():
pod, err := s.extractFromFile(path)
if err != nil {
glog.Errorf("Can't process manifest file %q: %v", path, err)
if !os.IsNotExist(err) {
glog.Errorf("Can't process manifest file %q: %v", path, err)
}
} else {
pods = append(pods, pod)
}