mirror of
https://github.com/TECHNOFAB11/zfs-localpv.git
synced 2025-12-12 06:20:11 +01:00
refact(deps): bump k8s and client-go deps to version v0.20.2 (#294)
Signed-off-by: prateekpandey14 <prateek.pandey@mayadata.io>
This commit is contained in:
parent
533e17a9aa
commit
b1aa6ab51a
2196 changed files with 306727 additions and 251810 deletions
|
|
@ -25,7 +25,8 @@ import (
|
|||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
"k8s.io/klog"
|
||||
"k8s.io/kubernetes/pkg/util/mount"
|
||||
utilexec "k8s.io/utils/exec"
|
||||
"k8s.io/utils/mount"
|
||||
)
|
||||
|
||||
// MountInfo contains the volume related info
|
||||
|
|
@ -51,7 +52,7 @@ type MountInfo struct {
|
|||
|
||||
// FormatAndMountZvol formats and mounts the created volume to the desired mount path
|
||||
func FormatAndMountZvol(devicePath string, mountInfo *MountInfo) error {
|
||||
mounter := &mount.SafeFormatAndMount{Interface: mount.New(""), Exec: mount.NewOsExec()}
|
||||
mounter := &mount.SafeFormatAndMount{Interface: mount.New(""), Exec: utilexec.New()}
|
||||
|
||||
err := mounter.FormatAndMount(devicePath, mountInfo.MountPath, mountInfo.FSType, mountInfo.MountOptions)
|
||||
if err != nil {
|
||||
|
|
@ -68,7 +69,7 @@ func FormatAndMountZvol(devicePath string, mountInfo *MountInfo) error {
|
|||
// UmountVolume unmounts the volume and the corresponding mount path is removed
|
||||
func UmountVolume(vol *apis.ZFSVolume, targetPath string,
|
||||
) error {
|
||||
mounter := &mount.SafeFormatAndMount{Interface: mount.New(""), Exec: mount.NewOsExec()}
|
||||
mounter := &mount.SafeFormatAndMount{Interface: mount.New(""), Exec: utilexec.New()}
|
||||
|
||||
dev, ref, err := mount.GetDeviceNameFromMount(mounter, targetPath)
|
||||
if err != nil {
|
||||
|
|
@ -274,10 +275,10 @@ func MountBlock(vol *apis.ZFSVolume, mountinfo *MountInfo) error {
|
|||
devicePath := ZFSDevPath + vol.Spec.PoolName + "/" + vol.Name
|
||||
mountopt := []string{"bind"}
|
||||
|
||||
mounter := &mount.SafeFormatAndMount{Interface: mount.New(""), Exec: mount.NewOsExec()}
|
||||
mounter := &mount.SafeFormatAndMount{Interface: mount.New(""), Exec: utilexec.New()}
|
||||
|
||||
// Create the mount point as a file since bind mount device node requires it to be a file
|
||||
err := mounter.MakeFile(target)
|
||||
err := makeFile(target)
|
||||
if err != nil {
|
||||
return status.Errorf(codes.Internal, "Could not create target file %q: %v", target, err)
|
||||
}
|
||||
|
|
@ -294,3 +295,14 @@ func MountBlock(vol *apis.ZFSVolume, mountinfo *MountInfo) error {
|
|||
|
||||
return nil
|
||||
}
|
||||
|
||||
func makeFile(pathname string) error {
|
||||
f, err := os.OpenFile(pathname, os.O_CREATE, os.FileMode(0644))
|
||||
defer f.Close()
|
||||
if err != nil {
|
||||
if !os.IsExist(err) {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import (
|
|||
|
||||
apis "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1"
|
||||
"k8s.io/klog"
|
||||
"k8s.io/kubernetes/pkg/util/mount"
|
||||
"k8s.io/utils/mount"
|
||||
)
|
||||
|
||||
// ResizeExtn can be used to run a resize command on the ext2/3/4 filesystem
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue