diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-03-08 17:03:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-08 17:03:59 +0100 |
commit | f378e82e2d57ee60e5b0f973eb1ea2ee3a760428 (patch) | |
tree | fb1f4a9e5a652c0be8ea98595e4e1c70712cdce1 /libpod | |
parent | 9e12f6354c4997a7eed241e03dcf2875db20e197 (diff) | |
parent | cb51707f91e683323ba61fca49363a997ed1be1f (diff) | |
download | podman-f378e82e2d57ee60e5b0f973eb1ea2ee3a760428.tar.gz podman-f378e82e2d57ee60e5b0f973eb1ea2ee3a760428.tar.bz2 podman-f378e82e2d57ee60e5b0f973eb1ea2ee3a760428.zip |
Merge pull request #5412 from rhatdan/tmpdir
Allow users to set TMPDIR environment
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/runtime_img.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libpod/runtime_img.go b/libpod/runtime_img.go index 6c45a2300..6ac32878b 100644 --- a/libpod/runtime_img.go +++ b/libpod/runtime_img.go @@ -209,11 +209,11 @@ func (r *Runtime) Import(ctx context.Context, source string, reference string, c } // donwloadFromURL downloads an image in the format "https:/example.com/myimage.tar" -// and temporarily saves in it /var/tmp/importxyz, which is deleted after the image is imported +// and temporarily saves in it $TMPDIR/importxyz, which is deleted after the image is imported func downloadFromURL(source string) (string, error) { fmt.Printf("Downloading from %q\n", source) - outFile, err := ioutil.TempFile("/var/tmp", "import") + outFile, err := ioutil.TempFile(util.Tmpdir(), "import") if err != nil { return "", errors.Wrap(err, "error creating file") } @@ -234,9 +234,9 @@ func downloadFromURL(source string) (string, error) { } // DownloadFromFile reads all of the content from the reader and temporarily -// saves in it /var/tmp/importxyz, which is deleted after the image is imported +// saves in it $TMPDIR/importxyz, which is deleted after the image is imported func DownloadFromFile(reader *os.File) (string, error) { - outFile, err := ioutil.TempFile("/var/tmp", "import") + outFile, err := ioutil.TempFile(util.Tmpdir(), "import") if err != nil { return "", errors.Wrap(err, "error creating file") } |