diff options
author | Chris Evich <cevich@redhat.com> | 2022-09-21 10:51:21 -0400 |
---|---|---|
committer | Chris Evich <cevich@redhat.com> | 2022-09-21 14:14:55 -0400 |
commit | ba6f84666ba601480951248a48d233eff2880ec1 (patch) | |
tree | a5cff50ad7a4fd0d923f8dc97326a5b28261b54b /pkg/bindings/images | |
parent | 12655484e39eadbc0fa0607542aa4a49a21013a1 (diff) | |
download | podman-ba6f84666ba601480951248a48d233eff2880ec1.tar.gz podman-ba6f84666ba601480951248a48d233eff2880ec1.tar.bz2 podman-ba6f84666ba601480951248a48d233eff2880ec1.zip |
Fix a few missed io/ioutil -> os updates
Ref: https://github.com/containers/podman/pull/15871
Signed-off-by: Chris Evich <cevich@redhat.com>
Diffstat (limited to 'pkg/bindings/images')
-rw-r--r-- | pkg/bindings/images/build.go | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/pkg/bindings/images/build.go b/pkg/bindings/images/build.go index ef875c9eb..260d977a8 100644 --- a/pkg/bindings/images/build.go +++ b/pkg/bindings/images/build.go @@ -9,7 +9,6 @@ import ( "fmt" "io" "io/fs" - "io/ioutil" "net/http" "net/url" "os" @@ -395,11 +394,11 @@ func Build(ctx context.Context, containerFiles []string, options entities.BuildO dontexcludes := []string{"!Dockerfile", "!Containerfile", "!.dockerignore", "!.containerignore"} for _, c := range containerFiles { if c == "/dev/stdin" { - content, err := ioutil.ReadAll(os.Stdin) + content, err := io.ReadAll(os.Stdin) if err != nil { return nil, err } - tmpFile, err := ioutil.TempFile("", "build") + tmpFile, err := os.CreateTemp("", "build") if err != nil { return nil, err } @@ -465,7 +464,7 @@ func Build(ctx context.Context, containerFiles []string, options entities.BuildO if arr[0] == "src" { // read specified secret into a tmp file // move tmp file to tar and change secret source to relative tmp file - tmpSecretFile, err := ioutil.TempFile(options.ContextDirectory, "podman-build-secret") + tmpSecretFile, err := os.CreateTemp(options.ContextDirectory, "podman-build-secret") if err != nil { return nil, err } @@ -531,7 +530,7 @@ func Build(ctx context.Context, containerFiles []string, options entities.BuildO if logrus.IsLevelEnabled(logrus.DebugLevel) { if v, found := os.LookupEnv("PODMAN_RETAIN_BUILD_ARTIFACT"); found { if keep, _ := strconv.ParseBool(v); keep { - t, _ := ioutil.TempFile("", "build_*_client") + t, _ := os.CreateTemp("", "build_*_client") defer t.Close() body = io.TeeReader(response.Body, t) } @@ -737,10 +736,10 @@ func nTar(excludes []string, sources ...string) (io.ReadCloser, error) { } func parseDockerignore(root string) ([]string, error) { - ignore, err := ioutil.ReadFile(filepath.Join(root, ".containerignore")) + ignore, err := os.ReadFile(filepath.Join(root, ".containerignore")) if err != nil { var dockerIgnoreErr error - ignore, dockerIgnoreErr = ioutil.ReadFile(filepath.Join(root, ".dockerignore")) + ignore, dockerIgnoreErr = os.ReadFile(filepath.Join(root, ".dockerignore")) if dockerIgnoreErr != nil && !os.IsNotExist(dockerIgnoreErr) { return nil, err } |