mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rbd: add check for imageFeatures parameter
This commit adds checks for missing `imageFeatures` parameter in createvolumerequest and nodestagerequest(only for static PVs). Missing `imageFeatures` parameter is ignored in case of non-static PVs to ensure backwards compatibility with older versions which did not have `imageFeatures` as required parameter. Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
@ -111,6 +111,10 @@ func (cs *ControllerServer) parseVolCreateRequest(ctx context.Context, req *csi.
|
||||
return nil, status.Error(codes.InvalidArgument, "multi node access modes are only supported on rbd `block` type volumes")
|
||||
}
|
||||
|
||||
if imageFeatures, ok := req.GetParameters()["imageFeatures"]; checkImageFeatures(imageFeatures, ok, true) {
|
||||
return nil, status.Error(codes.InvalidArgument, "missing required parameter imageFeatures")
|
||||
}
|
||||
|
||||
// if it's NOT SINGLE_NODE_WRITER and it's BLOCK we'll set the parameter to ignore the in-use checks
|
||||
rbdVol, err := genVolFromVolumeOptions(ctx, req.GetParameters(), req.GetSecrets(), (isMultiNode && isBlock))
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user