From 708800ddc18de5c3fd627c83d3cd0b229aed959b Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Wed, 7 Jul 2021 10:22:35 +0530 Subject: [PATCH] rbd: set thick metadata if ThickProvision is set instead of checking the parent is thick provisioned or not we can decide based on the rbdVol generated from the request. If the request is to create a Thick Image. set metadata without checking the parent. Signed-off-by: Madhu Rajanna --- internal/rbd/clone.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/internal/rbd/clone.go b/internal/rbd/clone.go index d7e77ba08..2b66f4361 100644 --- a/internal/rbd/clone.go +++ b/internal/rbd/clone.go @@ -170,13 +170,7 @@ func (rv *rbdVolume) createCloneFromImage(ctx context.Context, parentVol *rbdVol } } - // TODO: copy thick provision config - thick, err := parentVol.isThickProvisioned() - if err != nil { - return fmt.Errorf("failed checking thick-provisioning of %q: %w", parentVol, err) - } - - if thick { + if rv.ThickProvision { err = rv.setThickProvisioned() if err != nil { return fmt.Errorf("failed mark %q thick-provisioned: %w", rv, err)