chore(refactor): move btrfs code out of zfs package

Signed-off-by: Pawan <pawan@mayadata.io>
This commit is contained in:
Pawan 2020-11-23 18:36:49 +05:30 committed by Kiran Mova
parent 3404bc032b
commit 935a544538
2 changed files with 10 additions and 7 deletions

View file

@ -23,6 +23,7 @@ import (
"fmt"
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1"
"github.com/openebs/zfs-localpv/pkg/btrfs"
k8serrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/klog"
"strings"
@ -442,7 +443,8 @@ func CreateClone(vol *apis.ZFSVolume) error {
return xfsGenerateUUID(volume)
}
if vol.Spec.FsType == "btrfs" {
return btrfsGenerateUUID(volume)
device := ZFSDevPath + volume
return btrfs.GenerateUUID(device)
}
return nil
}
@ -815,7 +817,8 @@ func CreateRestore(rstr *apis.ZFSRestore) error {
return xfsGenerateUUID(volume)
}
if vol.Spec.FsType == "btrfs" {
return btrfsGenerateUUID(volume)
device := ZFSDevPath + volume
return btrfs.GenerateUUID(device)
}
return nil