From ceb88d649801b96c87a1116c341ae31bcfcbe0a8 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Tue, 14 Jun 2022 12:17:32 +0530 Subject: [PATCH] cephfs: remove extra check for restore size Looks like cephfs snapshot size is buggy and its getting removed in ceph fs. we cannot get the size of the snapshot during CreateVolume call, so we cannot do any size check at CreateVolume to check if the restore size is smaller or not. As we are removing this check it also fixes #3147 but we dont have any validation at CSI level for smaller restore we need to depend on kubernetes external-provisioner for it. fixes: #3147 Signed-off-by: Madhu Rajanna --- internal/cephfs/controllerserver.go | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/internal/cephfs/controllerserver.go b/internal/cephfs/controllerserver.go index 648bcba04..dc314976d 100644 --- a/internal/cephfs/controllerserver.go +++ b/internal/cephfs/controllerserver.go @@ -205,23 +205,7 @@ func checkValidCreateVolumeRequest( return errors.New("cloning snapshot-backed volumes is currently not supported") } case sID != nil: - if vol.Size < parentVol.Size { - return fmt.Errorf( - "cannot restore from snapshot %s: volume size %d is smaller than source volume size %d", - sID.SnapshotID, - parentVol.Size, - vol.Size) - } - if vol.BackingSnapshot { - if vol.Size != parentVol.Size { - return fmt.Errorf( - "cannot create snapshot-backed volume of different size: expected %d bytes, got %d bytes", - parentVol.Size, - vol.Size, - ) - } - volCaps := req.GetVolumeCapabilities() for _, volCap := range volCaps { mode := volCap.AccessMode.Mode