mirror of
https://git.mirrors.martin98.com/https://github.com/ceph/ceph-csi.git
synced 2025-08-16 05:35:57 +08:00
cephfs: allow readonly only for volume with contentsource
It doesnot make sense to allow the creation of empty volumes with readonly access, 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> (cherry picked from commit 860b65c446f2b9c1ddc221c6f378c1d2f71fcbba)
This commit is contained in:
parent
5a7e188bb4
commit
d7e3f06384
@ -73,6 +73,12 @@ func (cs *ControllerServer) validateCreateVolumeRequest(req *csi.CreateVolumeReq
|
||||
}
|
||||
}
|
||||
|
||||
// Allow readonly access mode for volume with content source
|
||||
err := util.CheckReadOnlyManyIsSupported(req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if req.VolumeContentSource != nil {
|
||||
volumeSource := req.VolumeContentSource
|
||||
switch volumeSource.Type.(type) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user