mirror of https://github.com/k3s-io/k3s
fix flexvol stuck issue due to corrupted mnt point
fix comments about PathExists fix comments revert change in PathExists funck3s-v1.14.4
parent
d1c99590f4
commit
e7c82c0250
|
@ -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 !pathExists {
|
if pathErr != nil {
|
||||||
klog.Warningf("Warning: Unmount skipped because path does not exist: %v", dir)
|
// only log warning here since plugins should anyways have to deal with errors
|
||||||
return nil
|
klog.Warningf("Error checking path: %v", pathErr)
|
||||||
}
|
} else {
|
||||||
|
if !pathExists {
|
||||||
if pathErr != nil && !mount.IsCorruptedMnt(pathErr) {
|
klog.Warningf("Warning: Unmount skipped because path does not exist: %v", dir)
|
||||||
return fmt.Errorf("Error checking path: %v", pathErr)
|
return nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
call := f.plugin.NewDriverCall(unmountCmd)
|
call := f.plugin.NewDriverCall(unmountCmd)
|
||||||
|
|
Loading…
Reference in New Issue