mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
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:
commit
f27a8034fd
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user