From 91bab239306b7ee0e09e7789dff774800ce75afd Mon Sep 17 00:00:00 2001
From: N Balachandran <nibalach@redhat.com>
Date: Tue, 31 May 2022 21:28:35 +0530
Subject: [PATCH] fix: creates the thinpool with the -Z option

This commit updates the lvcreate command used to create
the thinpool with the -Z option to enable zeroing. This removes
the requirement that the thin_pool_zero option be enabled in the
lvm.conf.

Signed-off-by: N Balachandran <nibalach@redhat.com>
---
 pkg/vgmanager/vgmanager_controller.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkg/vgmanager/vgmanager_controller.go b/pkg/vgmanager/vgmanager_controller.go
index a3fcd3047..2068b16b1 100644
--- a/pkg/vgmanager/vgmanager_controller.go
+++ b/pkg/vgmanager/vgmanager_controller.go
@@ -259,7 +259,7 @@ func (r *VGReconciler) addThinPoolToVG(vgName string, config *lvmv1alpha1.ThinPo
 		}
 	}
 
-	args := []string{"-l", fmt.Sprintf("%d%%FREE", config.SizePercent), "-c", DefaultChunkSize, "-T", fmt.Sprintf("%s/%s", vgName, config.Name)}
+	args := []string{"-l", fmt.Sprintf("%d%%FREE", config.SizePercent), "-c", DefaultChunkSize, "-Z", "y", "-T", fmt.Sprintf("%s/%s", vgName, config.Name)}
 
 	_, err = r.executor.ExecuteCommandWithOutputAsHost(lvCreateCmd, args...)
 	if err != nil {