From e74dbe630df461106db5f873934bd8df76bcfc4b Mon Sep 17 00:00:00 2001 From: Isteb4k Date: Mon, 9 Dec 2024 15:37:47 +0100 Subject: [PATCH] feat(cdi): configure clone strategy of storage profile Signed-off-by: Isteb4k --- .../patches/020-configure-clone-stratagy.patch | 12 ++++++++++++ .../patches/021-optimize-csi-clone.patch | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 images/cdi-artifact/patches/020-configure-clone-stratagy.patch create mode 100644 images/cdi-artifact/patches/021-optimize-csi-clone.patch diff --git a/images/cdi-artifact/patches/020-configure-clone-stratagy.patch b/images/cdi-artifact/patches/020-configure-clone-stratagy.patch new file mode 100644 index 0000000000..260c053d3c --- /dev/null +++ b/images/cdi-artifact/patches/020-configure-clone-stratagy.patch @@ -0,0 +1,12 @@ +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, diff --git a/images/cdi-artifact/patches/021-optimize-csi-clone.patch b/images/cdi-artifact/patches/021-optimize-csi-clone.patch new file mode 100644 index 0000000000..e90c9ecfba --- /dev/null +++ b/images/cdi-artifact/patches/021-optimize-csi-clone.patch @@ -0,0 +1,18 @@ +diff --git a/pkg/controller/clone/csi-clone.go b/pkg/controller/clone/csi-clone.go +index cbaff4c0d..8e2ea2714 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 ++ // TODO: 111. ++ // 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 != "" {