io/ioutil has already been deprecated in golang 1.16, so replace all ioutil with io and os
This commit is contained in:
@@ -27,7 +27,6 @@ import (
|
||||
"encoding/json"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
|
||||
"math/rand"
|
||||
"os"
|
||||
@@ -260,7 +259,7 @@ func validateSystem() error {
|
||||
}
|
||||
|
||||
func maskLocksmithdOnCoreos() {
|
||||
data, err := ioutil.ReadFile("/etc/os-release")
|
||||
data, err := os.ReadFile("/etc/os-release")
|
||||
if err != nil {
|
||||
// Not all distros contain this file.
|
||||
klog.Infof("Could not read /etc/os-release: %v", err)
|
||||
@@ -350,7 +349,7 @@ func getAPIServerClient() (*clientset.Clientset, error) {
|
||||
// loadSystemSpecFromFile returns the system spec from the file with the
|
||||
// filename.
|
||||
func loadSystemSpecFromFile(filename string) (*system.SysSpec, error) {
|
||||
b, err := ioutil.ReadFile(filename)
|
||||
b, err := os.ReadFile(filename)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user