mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #75234 from andyzhangx/corrupt-mnt-fix
fix pod stuck issue due to corrupt mnt point in flexvol plugin
This commit is contained in:
commit
3a598d7f92
@ -42,15 +42,15 @@ func (f *flexVolumeUnmounter) TearDown() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (f *flexVolumeUnmounter) TearDownAt(dir string) error {
|
func (f *flexVolumeUnmounter) TearDownAt(dir string) error {
|
||||||
|
|
||||||
pathExists, pathErr := mount.PathExists(dir)
|
pathExists, pathErr := mount.PathExists(dir)
|
||||||
|
if pathErr != nil {
|
||||||
|
// only log warning here since plugins should anyways have to deal with errors
|
||||||
|
klog.Warningf("Error checking path: %v", pathErr)
|
||||||
|
} else {
|
||||||
if !pathExists {
|
if !pathExists {
|
||||||
klog.Warningf("Warning: Unmount skipped because path does not exist: %v", dir)
|
klog.Warningf("Warning: Unmount skipped because path does not exist: %v", dir)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if pathErr != nil && !mount.IsCorruptedMnt(pathErr) {
|
|
||||||
return fmt.Errorf("Error checking path: %v", pathErr)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
call := f.plugin.NewDriverCall(unmountCmd)
|
call := f.plugin.NewDriverCall(unmountCmd)
|
||||||
|
Loading…
Reference in New Issue
Block a user