From 30f625743bfe8e1d45106d40b16df5f2cf2d53e9 Mon Sep 17 00:00:00 2001 From: Paul Laffitte Date: Wed, 31 Mar 2021 12:37:05 +0200 Subject: [PATCH] feat(controller): volume cloning closes #21 --- pkg/controller/controller.go | 2 +- pkg/controller/provisioner.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/controller/controller.go b/pkg/controller/controller.go index ec12f35b..c1ddadf6 100644 --- a/pkg/controller/controller.go +++ b/pkg/controller/controller.go @@ -111,7 +111,7 @@ func (controller *Controller) ControllerGetCapabilities(ctx context.Context, req csi.ControllerServiceCapability_RPC_PUBLISH_UNPUBLISH_VOLUME, csi.ControllerServiceCapability_RPC_CREATE_DELETE_SNAPSHOT, csi.ControllerServiceCapability_RPC_LIST_SNAPSHOTS, - // csi.ControllerServiceCapability_RPC_CLONE_VOLUME, + csi.ControllerServiceCapability_RPC_CLONE_VOLUME, csi.ControllerServiceCapability_RPC_EXPAND_VOLUME, } diff --git a/pkg/controller/provisioner.go b/pkg/controller/provisioner.go index fe22bcf0..71f3c00b 100644 --- a/pkg/controller/provisioner.go +++ b/pkg/controller/provisioner.go @@ -71,12 +71,12 @@ func (controller *Controller) CreateVolume(ctx context.Context, req *csi.CreateV } if sourceID != "" { - controller.dothillClient.VolumeCopy(sourceID, volumeID, parameters[common.PoolConfigKey]) + _, _, err = controller.dothillClient.CopyVolume(sourceID, volumeID, parameters[common.PoolConfigKey]) } else { _, _, err = controller.dothillClient.CreateVolume(volumeID, sizeStr, parameters[common.PoolConfigKey]) - if err != nil { - return nil, err - } + } + if err != nil { + return nil, err } }