Skip to content

Commit

Permalink
Let NodeUnpublishVolume pass when it cannot find volume (#73)
Browse files Browse the repository at this point in the history
This can happen when the volume is manually unmounted or the kubelet's
volume bread crumbs in the pod's namespace have been manually removed.

Signed-off-by: Dean Roehrich <[email protected]>
  • Loading branch information
roehrich-hpe authored Apr 30, 2024
1 parent d89a0bc commit c559e76
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/lustre-driver/service/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package service

import (
"os"
"strings"

log "github.com/sirupsen/logrus"
"golang.org/x/net/context"
Expand Down Expand Up @@ -121,7 +122,9 @@ func (s *service) NodeUnpublishVolume(

mounter := mount.New("")
notMountPoint, err := mount.IsNotMountPoint(mounter, req.GetTargetPath())
if err != nil {
if err != nil && strings.Contains(err.Error(), "no such") {
// consider it unmounted
} else if err != nil {
return nil, status.Errorf(codes.Internal, "NodeUnpublishVolume - Mount point check Failed: Error %v", err)
} else if !notMountPoint {
err := mounter.Unmount(req.GetTargetPath())
Expand Down

0 comments on commit c559e76

Please sign in to comment.