Merge pull request #79131 from andyzhangx/automated-cherry-pick-of-#75234-upstream-release-1.14

Automated cherry pick of #75234: fix flexvol stuck issue due to corrupted mnt point
k3s-v1.14.4
Kubernetes Prow Robot 2019-06-20 16:14:43 -07:00 committed by GitHub
commit 6b360e905b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 8 deletions

View File

@ -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)