diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-03-04 10:35:01 +0100 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-03-04 10:35:04 +0100 |
commit | 9bf8bd7bcbf347c11158e6857b7e4cc8ef47680c (patch) | |
tree | 2398b08d0835d23f5fdf7b579a36b45b7447fa11 /libpod/runtime.go | |
parent | f3a3d8e28e4b8ec06dd11ec156c10e243165f19d (diff) | |
download | podman-9bf8bd7bcbf347c11158e6857b7e4cc8ef47680c.tar.gz podman-9bf8bd7bcbf347c11158e6857b7e4cc8ef47680c.tar.bz2 podman-9bf8bd7bcbf347c11158e6857b7e4cc8ef47680c.zip |
runtime: fill a proper default tmpdir when --config is used
Closes: https://github.com/containers/libpod/issues/2408
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'libpod/runtime.go')
-rw-r--r-- | libpod/runtime.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go index f53cdd8b8..112b6820a 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -477,6 +477,12 @@ func NewRuntimeFromConfig(configPath string, options ...RuntimeOption) (runtime runtime.config.OCIRuntime = defaultRuntimeConfig.OCIRuntime runtime.config.StorageConfig = storage.StoreOptions{} + tmpDir, err := getDefaultTmpDir() + if err != nil { + return nil, err + } + runtime.config.TmpDir = tmpDir + // Check to see if the given configuration file exists if _, err := os.Stat(configPath); err != nil { return nil, errors.Wrapf(err, "error checking existence of configuration file %s", configPath) |