From c559e76880e8380e1fe1bdbdbfe3b229ea995b3b Mon Sep 17 00:00:00 2001 From: Dean Roehrich Date: Tue, 30 Apr 2024 09:30:29 -0500 Subject: [PATCH] Let NodeUnpublishVolume pass when it cannot find volume (#73) 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 --- pkg/lustre-driver/service/node.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/lustre-driver/service/node.go b/pkg/lustre-driver/service/node.go index 49032a3..b5f5137 100644 --- a/pkg/lustre-driver/service/node.go +++ b/pkg/lustre-driver/service/node.go @@ -21,6 +21,7 @@ package service import ( "os" + "strings" log "github.com/sirupsen/logrus" "golang.org/x/net/context" @@ -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())