mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 04:06:03 +00:00
Merge pull request #86277 from yutedz/subpath-walk-nil
Check FileInfo against nil during walk of container dir path
This commit is contained in:
commit
a57a8f33b3
@ -240,7 +240,8 @@ func doCleanSubPaths(mounter mount.Interface, podDir string, volumeName string)
|
||||
return err
|
||||
}
|
||||
|
||||
if info.IsDir() {
|
||||
// We need to check that info is not nil. This may happen when the incoming err is not nil due to stale mounts or permission errors.
|
||||
if info != nil && info.IsDir() {
|
||||
// skip subdirs of the volume: it only matters the first level to unmount, otherwise it would try to unmount subdir of the volume
|
||||
return filepath.SkipDir
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user