fix: Remove references to deprecated io/ioutil pkg (#2867)

* Update benchmark_test

* Updae tar.go

* Update further refs

* Commit next set of replacements

* Reverting changes in vendor folder

* Update integreation_with_context_test.go

* Update k8s_test.go

* Update remaining usages

* Replace conflicting usage of fs local variable
This commit is contained in:
Manish Giri
2023-11-28 13:02:53 -08:00
committed by GitHub
parent 2b3d3c7eff
commit 7bfc73c3ad
32 changed files with 173 additions and 143 deletions
+4 -3
View File
@@ -19,8 +19,9 @@ package dockerfile
import (
"bytes"
"fmt"
"io/ioutil"
"io"
"net/http"
"os"
"regexp"
"strconv"
"strings"
@@ -44,9 +45,9 @@ func ParseStages(opts *config.KanikoOptions) ([]instructions.Stage, []instructio
if e != nil {
return nil, nil, e
}
d, err = ioutil.ReadAll(response.Body)
d, err = io.ReadAll(response.Body)
} else {
d, err = ioutil.ReadFile(opts.DockerfilePath)
d, err = os.ReadFile(opts.DockerfilePath)
}
if err != nil {
+1 -2
View File
@@ -18,7 +18,6 @@ package dockerfile
import (
"fmt"
"io/ioutil"
"os"
"reflect"
"testing"
@@ -45,7 +44,7 @@ func Test_ParseStages_ArgValueWithQuotes(t *testing.T) {
FROM scratch
COPY --from=second /hi2 /hi3
`
tmpfile, err := ioutil.TempFile("", "Dockerfile.test")
tmpfile, err := os.CreateTemp("", "Dockerfile.test")
if err != nil {
t.Fatal(err)
}