From 4b49fd59733790e4b02330c9df3c8fbec4000a75 Mon Sep 17 00:00:00 2001 From: Chin-Ya Huang Date: Tue, 11 Feb 2020 15:24:11 +0800 Subject: [PATCH] Return error when NodePublishVolume mount fails Signed-off-by: Chin-Ya Huang --- pkg/hostpath/nodeserver.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/hostpath/nodeserver.go b/pkg/hostpath/nodeserver.go index 4f7912f8b..f7ac0cf4c 100644 --- a/pkg/hostpath/nodeserver.go +++ b/pkg/hostpath/nodeserver.go @@ -181,6 +181,7 @@ func (ns *nodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublis errList.WriteString(fmt.Sprintf(" :%s", rmErr.Error())) } } + return nil, status.Error(codes.Internal, fmt.Sprintf("failed to mount device: %s at %s: %s", path, targetPath, errList.String())) } }