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 <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna 2021-07-07 10:22:35 +05:30 committed by mergify[bot]
parent f471a206c5
commit 708800ddc1

View File

@ -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)