From 84c2a5518e78eb6ec9bc32c2239ae45d4b42007e Mon Sep 17 00:00:00 2001 From: Jing Xu Date: Mon, 26 Apr 2021 12:44:26 -0700 Subject: [PATCH] Fix cleanupMountpoint issue for Windows For windows, after unmount, the symlink is already removed. The previous logic uses removePathIfNotMountPoint which will return error if path no longer exist. This PR add the logic to return no error after unmount and path is no longer exist. Change-Id: Ie90ee698c95c3d2f0db8f13e3a8761638424c066 --- staging/src/k8s.io/mount-utils/mount_helper_common.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/staging/src/k8s.io/mount-utils/mount_helper_common.go b/staging/src/k8s.io/mount-utils/mount_helper_common.go index a7987485562..dd4dc2c8e5a 100644 --- a/staging/src/k8s.io/mount-utils/mount_helper_common.go +++ b/staging/src/k8s.io/mount-utils/mount_helper_common.go @@ -122,6 +122,10 @@ func removePathIfNotMountPoint(mountPath string, mounter Interface, extensiveMou } if err != nil { + if os.IsNotExist(err) { + klog.V(4).Infof("%q does not exist", mountPath) + return true, nil + } return notMnt, err }