mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-18 18:58:32 +02:00
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:
@@ -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 {
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user