rbd: make image features as optional parameter

Makes the rbd images features in the storageclass
as optional so that default image features of librbd
can be used. and also kept the option to user
to specify the image features in the storageclass.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna
2022-02-17 11:54:47 +05:30
committed by mergify[bot]
parent fb3835691f
commit d5c98f81a2
9 changed files with 127 additions and 26 deletions

View File

@ -115,8 +115,8 @@ func (cs *ControllerServer) parseVolCreateRequest(
"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 imageFeatures, ok := req.GetParameters()["imageFeatures"]; !checkValidImageFeatures(imageFeatures, ok) {
return nil, status.Error(codes.InvalidArgument, "empty imageFeatures parameter")
}
// if it's NOT SINGLE_NODE_WRITER, and it's BLOCK we'll set the parameter to ignore the in-use checks