mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 02:50:30 +00:00
reject block volume creation in cephfs
Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
This commit is contained in:
parent
1552df6b91
commit
9ddc265c10
@ -111,10 +111,17 @@ func (cs *controllerServer) validateCreateVolumeRequest(req *csi.CreateVolumeReq
|
|||||||
return status.Error(codes.InvalidArgument, "Volume Name cannot be empty")
|
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")
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user