summaryrefslogtreecommitdiff
path: root/pkg/util/utils.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-03-08 17:03:59 +0100
committerGitHub <noreply@github.com>2020-03-08 17:03:59 +0100
commitf378e82e2d57ee60e5b0f973eb1ea2ee3a760428 (patch)
treefb1f4a9e5a652c0be8ea98595e4e1c70712cdce1 /pkg/util/utils.go
parent9e12f6354c4997a7eed241e03dcf2875db20e197 (diff)
parentcb51707f91e683323ba61fca49363a997ed1be1f (diff)
downloadpodman-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 'pkg/util/utils.go')
-rw-r--r--pkg/util/utils.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/util/utils.go b/pkg/util/utils.go
index 4a52ea68d..a4df48c88 100644
--- a/pkg/util/utils.go
+++ b/pkg/util/utils.go
@@ -600,3 +600,12 @@ func HomeDir() (string, error) {
}
return home, nil
}
+
+func Tmpdir() string {
+ tmpdir := os.Getenv("TMPDIR")
+ if tmpdir == "" {
+ tmpdir = "/var/tmp"
+ }
+
+ return tmpdir
+}