Skip to content

Commit

Permalink
Let NodeUnpublishVolume pass when it cannot find volume
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 committed Apr 29, 2024
1 parent d89a0bc commit 1964ad8
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 1964ad8

Please sign in to comment.