-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cdi): improve csi-clone performance
Signed-off-by: Isteb4k <[email protected]>
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
diff --git a/pkg/controller/clone/csi-clone.go b/pkg/controller/clone/csi-clone.go | ||
index cbaff4c0d..e66a708cd 100644 | ||
--- a/pkg/controller/clone/csi-clone.go | ||
+++ b/pkg/controller/clone/csi-clone.go | ||
@@ -103,9 +103,10 @@ func (p *CSIClonePhase) createClaim(ctx context.Context) (*corev1.PersistentVolu | ||
Name: sourceClaim.Name, | ||
} | ||
|
||
- sourceSize := sourceClaim.Status.Capacity[corev1.ResourceStorage] | ||
- p.Log.V(3).Info("setting desired pvc request size to", "restoreSize", sourceSize) | ||
- desiredClaim.Spec.Resources.Requests[corev1.ResourceStorage] = sourceSize | ||
+ // With csi-clone, it's possible to specify the same or a larger capacity for the target pvc immediately, with no need to postpone resizing. | ||
+ // sourceSize := sourceClaim.Status.Capacity[corev1.ResourceStorage] | ||
+ // p.Log.V(3).Info("setting desired pvc request size to", "restoreSize", sourceSize) | ||
+ // desiredClaim.Spec.Resources.Requests[corev1.ResourceStorage] = sourceSize | ||
|
||
cc.AddAnnotation(desiredClaim, cc.AnnPopulatorKind, cdiv1.VolumeCloneSourceRef) | ||
if p.OwnershipLabel != "" { | ||
diff --git a/pkg/storagecapabilities/storagecapabilities.go b/pkg/storagecapabilities/storagecapabilities.go | ||
index 11862364e..1d4fb97f2 100644 | ||
--- a/pkg/storagecapabilities/storagecapabilities.go | ||
+++ b/pkg/storagecapabilities/storagecapabilities.go | ||
@@ -144,6 +144,7 @@ var CloneStrategyByProvisionerKey = map[string]cdiv1.CDICloneStrategy{ | ||
"hspc.csi.hitachi.com": cdiv1.CloneStrategyCsiClone, | ||
"csi.hpe.com": cdiv1.CloneStrategyCsiClone, | ||
"spectrumscale.csi.ibm.com": cdiv1.CloneStrategyCsiClone, | ||
+ "rbd.csi.ceph.com": cdiv1.CloneStrategyCsiClone, | ||
"rook-ceph.rbd.csi.ceph.com": cdiv1.CloneStrategyCsiClone, | ||
"openshift-storage.rbd.csi.ceph.com": cdiv1.CloneStrategyCsiClone, | ||
"cephfs.csi.ceph.com": cdiv1.CloneStrategyCsiClone, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters