mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-22 04:50:23 +00:00
cephfs: block creation of ROX clone from ROX volume
As there is no usecase currently, blocking the creation of ROX clone from the ROX volume. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
e013cfed15
commit
5d034b1124
@ -214,6 +214,7 @@ func checkValidCreateVolumeRequest(
|
||||
sID *store.SnapshotIdentifier,
|
||||
req *csi.CreateVolumeRequest,
|
||||
) error {
|
||||
volCaps := req.GetVolumeCapabilities()
|
||||
switch {
|
||||
case pvID != nil:
|
||||
if vol.Size < parentVol.Size {
|
||||
@ -224,12 +225,12 @@ func checkValidCreateVolumeRequest(
|
||||
vol.Size)
|
||||
}
|
||||
|
||||
if vol.BackingSnapshot {
|
||||
return errors.New("cloning snapshot-backed volumes is currently not supported")
|
||||
if parentVol.BackingSnapshot && store.IsVolumeCreateRO(volCaps) {
|
||||
return errors.New("creating read-only clone from a snapshot-backed volume is not supported")
|
||||
}
|
||||
|
||||
case sID != nil:
|
||||
if vol.BackingSnapshot {
|
||||
volCaps := req.GetVolumeCapabilities()
|
||||
isRO := store.IsVolumeCreateRO(volCaps)
|
||||
if !isRO {
|
||||
return errors.New("backingSnapshot may be used only with read-only access modes")
|
||||
|
Loading…
Reference in New Issue
Block a user