mirror of
https://github.com/containers/podman.git
synced 2025-06-22 09:58:10 +08:00
Allow users to specify TMPDIR in containers.conf
Currently we hard code TMPDIR environment variable to /var/tmp if it is not set in the Environment. This causes TMPDIR environment variable to be ignored if set in containers.conf. This change now uses the host environment TMPDIR, followed by containers.conf and then hard codes TMPDIR, if it was not set. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -31,11 +31,6 @@ func main() {
|
||||
return
|
||||
}
|
||||
|
||||
// Hard code TMPDIR functions to use /var/tmp, if user did not override
|
||||
if _, ok := os.LookupEnv("TMPDIR"); !ok {
|
||||
os.Setenv("TMPDIR", "/var/tmp")
|
||||
}
|
||||
|
||||
rootCmd = parseCommands()
|
||||
|
||||
Execute()
|
||||
|
@ -178,6 +178,10 @@ func persistentPreRunE(cmd *cobra.Command, args []string) error {
|
||||
return err
|
||||
}
|
||||
}
|
||||
// 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 !registry.IsRemote() {
|
||||
if cmd.Flag("cpu-profile").Changed {
|
||||
|
Reference in New Issue
Block a user