Skip to content

Commit

Permalink
fix: check that StagingTargetPath is mount point
Browse files Browse the repository at this point in the history
  • Loading branch information
antonmyagkov committed Oct 3, 2024
1 parent 8f67155 commit e414b69
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cloud/blockstore/tools/csi_driver/internal/driver/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,11 @@ func (s *nodeService) nodeUnstageVolume(
ctx context.Context,
req *csi.NodeUnstageVolumeRequest) error {

mounted, _ := s.mounter.IsMountPoint(req.StagingTargetPath)
if !mounted {
return nil
}

if err := s.mounter.CleanupMountPoint(req.StagingTargetPath); err != nil {
return err
}
Expand Down

0 comments on commit e414b69

Please sign in to comment.