From 102ed7d35cc9b6b337c495bb211675f860aaa14a Mon Sep 17 00:00:00 2001 From: Abhinandan Purkait Date: Wed, 8 Jan 2025 06:32:54 +0000 Subject: [PATCH 1/2] fix: remove invalid character from the set command Signed-off-by: Abhinandan Purkait --- pkg/zfs/zfs_util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/zfs/zfs_util.go b/pkg/zfs/zfs_util.go index f0ed321f..cd43c6a8 100644 --- a/pkg/zfs/zfs_util.go +++ b/pkg/zfs/zfs_util.go @@ -298,7 +298,7 @@ func buildVolumeResizeArgs(vol *apis.ZFSVolume) []string { } if vol.Spec.ThinProvision == "no" { - ZFSVolArg = append(ZFSVolArg, "-o", reservationProperty(vol.Spec.QuotaType, vol.Spec.Capacity)) + ZFSVolArg = append(ZFSVolArg, reservationProperty(vol.Spec.QuotaType, vol.Spec.Capacity)) } ZFSVolArg = append(ZFSVolArg, volume) From 04792689f681fccc01357138a3680fd01cf6c679 Mon Sep 17 00:00:00 2001 From: Abhinandan Purkait Date: Wed, 8 Jan 2025 06:33:18 +0000 Subject: [PATCH 2/2] test: quota and refquota params Signed-off-by: Abhinandan Purkait --- tests/utils.go | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/tests/utils.go b/tests/utils.go index cf23e94c..a8102a0b 100644 --- a/tests/utils.go +++ b/tests/utils.go @@ -150,11 +150,19 @@ func VerifyStorageClassParams(property map[string]string) { // Refer https://github.com/openebs/zfs-localpv/issues/560#issuecomment-2232535073 func generateThinProvisionParams(property map[string]string) { if property["fstype"] == "zfs" { - property["quota"] = capacity - property["reservation"] = defaultReservation - if property["thinprovision"] == "no" { - property["reservation"] = capacity + if property["quotatype"] == "quota" { + property["quota"] = string(capacity) + if property["thinprovision"] == "no" { + property["reservation"] = string(capacity) + } + } + if property["quotatype"] == "refquota" { + property["refquota"] = string(capacity) + if property["thinprovision"] == "no" { + property["refreservation"] = string(capacity) + } } + delete(property, "quotatype") } else { property["quota"] = "-" property["reservation"] = defaultReservation @@ -701,5 +709,18 @@ func getStoragClassParams() []map[string]string { "fstype": "xfs", "compression": "zstd-fast", }, + { + "fstype": "zfs", + "quotatype": "quota", + }, + { + "fstype": "zfs", + "quotatype": "refquota", + }, + { + "fstype": "zfs", + "thinprovision": "no", + "quotatype": "refquota", + }, } }