Add staging target path validation to nodeserver

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
Humble Chirammal 2019-06-06 20:36:41 +05:30
parent dc04362ac5
commit 3e2d2787b6
2 changed files with 4 additions and 3 deletions

View File

@ -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
}

View File

@ -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) {