From 1964ad8c15dd7ef2ffb8f63a4bca2c3dfc270af4 Mon Sep 17 00:00:00 2001 From: Dean Roehrich Date: Mon, 29 Apr 2024 10:46:55 -0500 Subject: [PATCH] Let NodeUnpublishVolume pass when it cannot find volume 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())