Merge pull request #130 from Madhu-1/fix-block

reject block volume creation in cephfs
This commit is contained in:
Huamin Chen 2019-01-16 07:18:27 -05:00 committed by GitHub
commit 07dbea766e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -110,10 +110,16 @@ 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
}