diff --git a/pkg/volume/util/volumepathhandler/BUILD b/pkg/volume/util/volumepathhandler/BUILD index df8126ee228..23b791e6c30 100644 --- a/pkg/volume/util/volumepathhandler/BUILD +++ b/pkg/volume/util/volumepathhandler/BUILD @@ -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", diff --git a/pkg/volume/util/volumepathhandler/volume_path_handler.go b/pkg/volume/util/volumepathhandler/volume_path_handler.go index 8d00deaf27a..ad192f437c8 100644 --- a/pkg/volume/util/volumepathhandler/volume_path_handler.go +++ b/pkg/volume/util/volumepathhandler/volume_path_handler.go @@ -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) }