chore(refactor): move xfs and mount code out of zfs package

Signed-off-by: Pawan <pawan@mayadata.io>
This commit is contained in:
Pawan 2020-11-25 18:49:51 +05:30 committed by Kiran Mova
parent 935a544538
commit d537bd3655
5 changed files with 86 additions and 59 deletions

View file

@ -24,6 +24,7 @@ import (
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1"
"github.com/openebs/zfs-localpv/pkg/btrfs"
"github.com/openebs/zfs-localpv/pkg/xfs"
k8serrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/klog"
"strings"
@ -440,7 +441,8 @@ func CreateClone(vol *apis.ZFSVolume) error {
}
if vol.Spec.FsType == "xfs" {
return xfsGenerateUUID(volume)
device := ZFSDevPath + volume
return xfs.GenerateUUID(device)
}
if vol.Spec.FsType == "btrfs" {
device := ZFSDevPath + volume
@ -814,7 +816,8 @@ func CreateRestore(rstr *apis.ZFSRestore) error {
* so that we can mount it.
*/
if vol.Spec.FsType == "xfs" {
return xfsGenerateUUID(volume)
device := ZFSDevPath + volume
return xfs.GenerateUUID(device)
}
if vol.Spec.FsType == "btrfs" {
device := ZFSDevPath + volume