Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cephfs: Add support to create RWX PVC from ROX PVC #4094

Merged
merged 3 commits into from
Aug 31, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
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>
  • Loading branch information
Madhu-1 committed Aug 31, 2023
commit 14e1a78c04919afe24bffed017751fc694f32652
7 changes: 4 additions & 3 deletions internal/cephfs/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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")
Expand Down