Skip to content

Commit

Permalink
skip invalid mountpoints on unpublish request
Browse files Browse the repository at this point in the history
  • Loading branch information
woehrl01 committed Mar 3, 2024
1 parent 32cd0a7 commit a4031a9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/plugin/node_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ func (n NodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpubl
}

mnt, err := n.k8smounter.IsMountPoint(req.TargetPath)
if !mnt || !os.IsNotExist(err) {
klog.Warningf("mount cleanup skipped: %s is not a mount point", req.TargetPath)
return &csi.NodeUnpublishVolumeResponse{}, nil
}

if err != nil || !mnt {
return &csi.NodeUnpublishVolumeResponse{}, err
}
Expand Down

0 comments on commit a4031a9

Please sign in to comment.