mirror of https://github.com/containers/podman.git
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>
This commit is contained in:
parent
f3a3d8e28e
commit
9bf8bd7bcb
|
|
@ -477,6 +477,12 @@ func NewRuntimeFromConfig(configPath string, options ...RuntimeOption) (runtime
|
||||||
runtime.config.OCIRuntime = defaultRuntimeConfig.OCIRuntime
|
runtime.config.OCIRuntime = defaultRuntimeConfig.OCIRuntime
|
||||||
runtime.config.StorageConfig = storage.StoreOptions{}
|
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
|
// Check to see if the given configuration file exists
|
||||||
if _, err := os.Stat(configPath); err != nil {
|
if _, err := os.Stat(configPath); err != nil {
|
||||||
return nil, errors.Wrapf(err, "error checking existence of configuration file %s", configPath)
|
return nil, errors.Wrapf(err, "error checking existence of configuration file %s", configPath)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue