mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-19 08:40:42 +00:00
Change mount.NewOSExec to utilexec.New
This commit is contained in:
parent
8a09460c2f
commit
560d9c56eb
@ -13,6 +13,7 @@ go_library(
|
||||
"//pkg/util/mount:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
|
||||
"//vendor/k8s.io/klog:go_default_library",
|
||||
"//vendor/k8s.io/utils/exec:go_default_library",
|
||||
] + select({
|
||||
"@io_bazel_rules_go//go/platform:android": [
|
||||
"//vendor/golang.org/x/sys/unix:go_default_library",
|
||||
|
@ -24,6 +24,7 @@ import (
|
||||
|
||||
"k8s.io/klog"
|
||||
"k8s.io/kubernetes/pkg/util/mount"
|
||||
utilexec "k8s.io/utils/exec"
|
||||
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
)
|
||||
@ -139,7 +140,7 @@ func mapBindMountDevice(v VolumePathHandler, devicePath string, mapPath string,
|
||||
}
|
||||
|
||||
// Bind mount file
|
||||
mounter := &mount.SafeFormatAndMount{Interface: mount.New(""), Exec: mount.NewOSExec()}
|
||||
mounter := &mount.SafeFormatAndMount{Interface: mount.New(""), Exec: utilexec.New()}
|
||||
if err := mounter.Mount(devicePath, linkPath, "" /* fsType */, []string{"bind"}); err != nil {
|
||||
return fmt.Errorf("failed to bind mount devicePath: %s to linkPath %s: %v", devicePath, linkPath, err)
|
||||
}
|
||||
@ -196,7 +197,7 @@ func unmapBindMountDevice(v VolumePathHandler, mapPath string, linkName string)
|
||||
}
|
||||
|
||||
// Unmount file
|
||||
mounter := &mount.SafeFormatAndMount{Interface: mount.New(""), Exec: mount.NewOSExec()}
|
||||
mounter := &mount.SafeFormatAndMount{Interface: mount.New(""), Exec: utilexec.New()}
|
||||
if err := mounter.Unmount(linkPath); err != nil {
|
||||
return fmt.Errorf("failed to unmount linkPath %s: %v", linkPath, err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user