diff --git a/internal/rbd/nodeserver.go b/internal/rbd/nodeserver.go index ca3307ecf..26fddf16f 100644 --- a/internal/rbd/nodeserver.go +++ b/internal/rbd/nodeserver.go @@ -18,6 +18,7 @@ package rbd import ( "context" + "errors" "fmt" "os" "strconv" @@ -675,7 +676,8 @@ func (ns *NodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstag } // If not mounted, and error is anything other than metadata file missing, it is an error - if _, ok := err.(ErrMissingStash); !ok { + var ems ErrMissingStash + if !errors.As(err, &ems) { return nil, status.Error(codes.Internal, err.Error()) }