mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-29 17:50:23 +00:00
Merge pull request #110 from pohly/block-volume-mode-check
rbd: refuse to create block volumes
This commit is contained in:
commit
3170ec455c
@ -76,6 +76,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