mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-22 14:20:19 +00:00
rbd: allow readonly only for volume with contentsource
It doesnot make sense to allow the creation of empty volumes which is going to be accessed with readonly mode, this commit allows the creation of volume which is having readonly capabilities only if the content source is set for the volume. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
d816df4f42
commit
2deabcd284
@ -80,6 +80,13 @@ func (cs *ControllerServer) validateVolumeReq(ctx context.Context, req *csi.Crea
|
||||
if value, ok := options["volumeNamePrefix"]; ok && value == "" {
|
||||
return status.Error(codes.InvalidArgument, "empty volume name prefix to provision volume from")
|
||||
}
|
||||
|
||||
// Allow readonly access mode for volume with content source
|
||||
err := util.CheckReadOnlyManyIsSupported(req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user