mirror of
https://github.com/kubernetes-sigs/kind.git
synced 2025-12-01 07:26:05 +07:00
Delete ioutil as it is Deprecated since Go 1.16
Signed-off-by: yanggang <gang.yang@daocloud.io>
This commit is contained in:
@@ -17,7 +17,7 @@ limitations under the License.
|
||||
package nodeimage
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"io"
|
||||
|
||||
"sigs.k8s.io/kind/pkg/exec"
|
||||
)
|
||||
@@ -49,7 +49,7 @@ func (c *containerdImporter) End() error {
|
||||
func (c *containerdImporter) Pull(image, platform string) error {
|
||||
return c.containerCmder.Command(
|
||||
"ctr", "--namespace=k8s.io", "content", "fetch", "--platform="+platform, image,
|
||||
).SetStdout(ioutil.Discard).SetStderr(ioutil.Discard).Run()
|
||||
).SetStdout(io.Discard).SetStderr(io.Discard).Run()
|
||||
}
|
||||
|
||||
func (c *containerdImporter) LoadCommand() exec.Cmd {
|
||||
|
||||
@@ -23,7 +23,6 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
@@ -58,7 +57,7 @@ func GetArchiveTags(path string) ([]string, error) {
|
||||
}
|
||||
}
|
||||
// read and parse the tags
|
||||
b, err := ioutil.ReadAll(tr)
|
||||
b, err := io.ReadAll(tr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -107,7 +106,7 @@ func EditArchive(reader io.Reader, writer io.Writer, editRepositories func(strin
|
||||
} else if err != nil {
|
||||
return err
|
||||
}
|
||||
b, err := ioutil.ReadAll(tarReader)
|
||||
b, err := io.ReadAll(tarReader)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user