Merge pull request #28911 from thockin/fix-gendocs-for-symlinks

Automatic merge from submit-queue

Don't panic if we hit a dangling symlink in mungedocs

I hit this because I have a dangling symlink, which would cause a panic.
This commit is contained in:
k8s-merge-robot 2016-07-13 20:55:34 -07:00 committed by GitHub
commit f27a8034fd

View File

@ -158,6 +158,12 @@ func (f fileProcessor) visit(path string) error {
func newWalkFunc(fp *fileProcessor, changesNeeded *bool) filepath.WalkFunc {
return func(path string, info os.FileInfo, err error) error {
stat, err := os.Stat(path)
if err != nil {
if os.IsNotExist(err) {
return nil
}
return err
}
if path != *rootDir && stat.IsDir() && *norecurse {
return filepath.SkipDir
}