mirror of
https://github.com/kubernetes/node-problem-detector.git
synced 2026-08-28 01:47:20 +00:00
chore: remove refs to deprecated io/ioutil
This commit is contained in:
@@ -17,7 +17,7 @@ limitations under the License.
|
||||
package makers
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
"github.com/golang/glog"
|
||||
)
|
||||
@@ -30,7 +30,7 @@ const ext4ErrorTrigger = "/sys/fs/ext4/sda1/trigger_fs_error"
|
||||
|
||||
func makeFilesystemError() {
|
||||
msg := []byte("fake filesystem error from problem-maker")
|
||||
err := ioutil.WriteFile(ext4ErrorTrigger, msg, 0200)
|
||||
err := os.WriteFile(ext4ErrorTrigger, msg, 0200)
|
||||
if err != nil {
|
||||
glog.Fatalf("Failed writing log to %q: %v", ext4ErrorTrigger, err)
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ limitations under the License.
|
||||
package makers
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/golang/glog"
|
||||
@@ -38,7 +38,7 @@ Killed process 1012 (heapster) total-vm:327128kB, anon-rss:306328kB, file-rss:11
|
||||
|
||||
func writeKernelMessageOrDie(msg string) {
|
||||
for _, line := range strings.Split(msg, "\n") {
|
||||
err := ioutil.WriteFile(kmsgPath, []byte(line), 0644)
|
||||
err := os.WriteFile(kmsgPath, []byte(line), 0644)
|
||||
if err != nil {
|
||||
glog.Fatalf("Failed writing to %q: %v", kmsgPath, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user