Delete ioutil as it is Deprecated since Go 1.16

Signed-off-by: yanggang <gang.yang@daocloud.io>
This commit is contained in:
yanggang
2023-04-02 21:03:55 +08:00
parent 6298ee7b51
commit 6a7169806f
15 changed files with 42 additions and 45 deletions

View File

@@ -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 {

View File

@@ -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
}