@@ -199,8 +199,7 @@ func (d *Driver) NodeUnstageVolume(_ context.Context, req *csi.NodeUnstageVolume
199
199
defer d .volumeLocks .Release (volumeID )
200
200
201
201
klog .V (2 ).Infof ("NodeUnstageVolume: unmounting %s" , stagingTargetPath )
202
- err := CleanupMountPoint (stagingTargetPath , d .mounter , true /*extensiveMountPointCheck*/ )
203
- if err != nil {
202
+ if err := CleanupMountPoint (stagingTargetPath , d .mounter , true /*extensiveMountPointCheck*/ ); err != nil {
204
203
return nil , status .Errorf (codes .Internal , "failed to unmount staging target %q: %v" , stagingTargetPath , err )
205
204
}
206
205
klog .V (2 ).Infof ("NodeUnstageVolume: unmount %s successfully" , stagingTargetPath )
@@ -299,8 +298,12 @@ func (d *Driver) NodeUnpublishVolume(_ context.Context, req *csi.NodeUnpublishVo
299
298
}
300
299
301
300
klog .V (2 ).Infof ("NodeUnpublishVolume: unmounting volume %s on %s" , volumeID , targetPath )
302
- err := CleanupMountPoint (targetPath , d .mounter , true /*extensiveMountPointCheck*/ )
303
- if err != nil {
301
+ extensiveMountPointCheck := true
302
+ if runtime .GOOS == "windows" {
303
+ // on Windows, this parameter indicates whether to unmount volume, not necessary in NodeUnpublishVolume
304
+ extensiveMountPointCheck = false
305
+ }
306
+ if err := CleanupMountPoint (targetPath , d .mounter , extensiveMountPointCheck ); err != nil {
304
307
return nil , status .Errorf (codes .Internal , "failed to unmount target %q: %v" , targetPath , err )
305
308
}
306
309
0 commit comments