From 3e2d2787b69e5863d8de83d34c0d9b000bce0078 Mon Sep 17 00:00:00 2001 From: Humble Chirammal Date: Thu, 6 Jun 2019 20:36:41 +0530 Subject: [PATCH] Add staging target path validation to nodeserver Signed-off-by: Humble Chirammal --- pkg/cephfs/util.go | 4 ++++ pkg/rbd/nodeserver.go | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/cephfs/util.go b/pkg/cephfs/util.go index 62a7c14ad..cdf79336d 100644 --- a/pkg/cephfs/util.go +++ b/pkg/cephfs/util.go @@ -180,6 +180,10 @@ func validateNodePublishVolumeRequest(req *csi.NodePublishVolumeRequest) error { return errors.New("target path missing in request") } + if req.GetStagingTargetPath() == "" { + return errors.New("staging target path missing in request") + } + return nil } diff --git a/pkg/rbd/nodeserver.go b/pkg/rbd/nodeserver.go index ded1c99ee..20c7a8b09 100644 --- a/pkg/rbd/nodeserver.go +++ b/pkg/rbd/nodeserver.go @@ -41,9 +41,6 @@ type NodeServer struct { mounter mount.Interface } -//TODO remove both stage and unstage methods -//once https://github.com/kubernetes-csi/drivers/pull/145 is merged - // NodePublishVolume mounts the volume mounted to the device path to the target // path func (ns *NodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error) {