mount-utils: stop using ioutil

It has been deprecated since Go 1.16.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin 2023-06-07 14:02:40 -07:00
parent b690450e84
commit 699d118d85

View File

@ -24,7 +24,6 @@ import (
"errors" "errors"
"fmt" "fmt"
"io/fs" "io/fs"
"io/ioutil"
"os" "os"
"os/exec" "os/exec"
"path/filepath" "path/filepath"
@ -270,7 +269,7 @@ func detectSafeNotMountedBehavior() bool {
// detectSafeNotMountedBehaviorWithExec is for testing with FakeExec. // detectSafeNotMountedBehaviorWithExec is for testing with FakeExec.
func detectSafeNotMountedBehaviorWithExec(exec utilexec.Interface) bool { func detectSafeNotMountedBehaviorWithExec(exec utilexec.Interface) bool {
// create a temp dir and try to umount it // create a temp dir and try to umount it
path, err := ioutil.TempDir("", "kubelet-detect-safe-umount") path, err := os.MkdirTemp("", "kubelet-detect-safe-umount")
if err != nil { if err != nil {
klog.V(4).Infof("Cannot create temp dir to detect safe 'not mounted' behavior: %v", err) klog.V(4).Infof("Cannot create temp dir to detect safe 'not mounted' behavior: %v", err)
return false return false