From 9ddc265c10780f42ea6adb14cf7a4111163c5130 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Wed, 16 Jan 2019 18:17:14 +0530 Subject: [PATCH] reject block volume creation in cephfs Signed-off-by: Madhu Rajanna --- pkg/cephfs/util.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/cephfs/util.go b/pkg/cephfs/util.go index f2e6f2c83..4c0e1b066 100644 --- a/pkg/cephfs/util.go +++ b/pkg/cephfs/util.go @@ -111,10 +111,17 @@ func (cs *controllerServer) validateCreateVolumeRequest(req *csi.CreateVolumeReq return status.Error(codes.InvalidArgument, "Volume Name cannot be empty") } - if req.GetVolumeCapabilities() == nil { + reqCaps := req.GetVolumeCapabilities() + if reqCaps == nil { return status.Error(codes.InvalidArgument, "Volume Capabilities cannot be empty") } + for _, cap := range reqCaps { + if cap.GetBlock() != nil { + return status.Error(codes.Unimplemented, "block volume not supported") + } + } + return nil }