summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-09-15 13:15:03 -0400
committerGitHub <noreply@github.com>2021-09-15 13:15:03 -0400
commitf9d8301c476fcd8498930c518f04920e9e8eeac5 (patch)
treeae020d660f63b6d41c016a4ca91ecd577a5c569d /cmd
parentc0cde378298bd8d5183155c8f62aae574be069eb (diff)
parent3e77f960f65687dcb1d571ebe70278028c6de441 (diff)
downloadpodman-f9d8301c476fcd8498930c518f04920e9e8eeac5.tar.gz
podman-f9d8301c476fcd8498930c518f04920e9e8eeac5.tar.bz2
podman-f9d8301c476fcd8498930c518f04920e9e8eeac5.zip
Merge pull request #11577 from rhatdan/tmpdir
Set default storage from containers.conf for temporary images
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/root.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd/podman/root.go b/cmd/podman/root.go
index c798e6634..02e6dcd27 100644
--- a/cmd/podman/root.go
+++ b/cmd/podman/root.go
@@ -174,7 +174,11 @@ func persistentPreRunE(cmd *cobra.Command, args []string) error {
}
// Hard code TMPDIR functions to use /var/tmp, if user did not override
if _, ok := os.LookupEnv("TMPDIR"); !ok {
- os.Setenv("TMPDIR", "/var/tmp")
+ if tmpdir, err := cfg.ImageCopyTmpDir(); err != nil {
+ logrus.Warnf("failed to retrieve default tmp dir: %s", err.Error())
+ } else {
+ os.Setenv("TMPDIR", tmpdir)
+ }
}
context := cmd.Root().LocalFlags().Lookup("context")