mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-19 21:00:24 +00:00
rbd: refuse to create block volumes
Without this check, the driver fails one of the E2E storage tests in
Kubernetes 1.13: provisioning a block volume is expected to fail in
e689d515f7/test/e2e/storage/testsuites/volumemode.go (L329-L330)
This commit is contained in:
parent
c0e775a49b
commit
51d6ac6f55
@ -54,6 +54,11 @@ func (cs *controllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol
|
|||||||
if req.VolumeCapabilities == nil {
|
if req.VolumeCapabilities == nil {
|
||||||
return nil, status.Error(codes.InvalidArgument, "Volume Capabilities cannot be empty")
|
return nil, status.Error(codes.InvalidArgument, "Volume Capabilities cannot be empty")
|
||||||
}
|
}
|
||||||
|
for _, cap := range req.VolumeCapabilities {
|
||||||
|
if cap.GetBlock() != nil {
|
||||||
|
return nil, status.Error(codes.Unimplemented, "Block Volume not supported")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
volumeNameMutex.LockKey(req.GetName())
|
volumeNameMutex.LockKey(req.GetName())
|
||||||
defer volumeNameMutex.UnlockKey(req.GetName())
|
defer volumeNameMutex.UnlockKey(req.GetName())
|
||||||
|
Loading…
Reference in New Issue
Block a user