mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-03 10:17:46 +00:00
io/ioutil has already been deprecated in golang 1.16, so replace all ioutil with io and os
This commit is contained in:
@@ -24,7 +24,6 @@ import (
|
||||
"context"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"math/rand"
|
||||
"net/http"
|
||||
"os"
|
||||
@@ -323,7 +322,7 @@ func prepareGceImages() (*internalImageConfig, error) {
|
||||
configPath = filepath.Join(*imageConfigDir, *imageConfigFile)
|
||||
}
|
||||
|
||||
imageConfigData, err := ioutil.ReadFile(configPath)
|
||||
imageConfigData, err := os.ReadFile(configPath)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Could not read image config file provided: %v", err)
|
||||
}
|
||||
@@ -895,7 +894,7 @@ func parseInstanceMetadata(str string) map[string]string {
|
||||
if *imageConfigDir != "" {
|
||||
metaPath = filepath.Join(*imageConfigDir, metaPath)
|
||||
}
|
||||
v, err := ioutil.ReadFile(metaPath)
|
||||
v, err := os.ReadFile(metaPath)
|
||||
if err != nil {
|
||||
klog.Fatalf("Failed to read metadata file %q: %v", metaPath, err)
|
||||
continue
|
||||
|
Reference in New Issue
Block a user