fix: io/ioutil deprecated

pull/16603/head
guoguangwu 2023-05-31 16:38:55 +08:00
parent 9f22f52878
commit 4d5265bba9
1 changed files with 1 additions and 2 deletions

View File

@ -18,7 +18,6 @@ package constants
import (
"fmt"
"io/ioutil"
"net"
"os"
"path"
@ -564,7 +563,7 @@ func CreateTempDirForKubeadm(kubernetesDir, dirName string) (string, error) {
return "", errors.Wrapf(err, "failed to create directory %q", tempDir)
}
tempDir, err := ioutil.TempDir(tempDir, dirName)
tempDir, err := os.MkdirTemp(tempDir, dirName)
if err != nil {
return "", errors.Wrap(err, "couldn't create a temporary directory")
}