diff options
author | Matthew Heon <matthew.heon@pm.me> | 2020-07-31 13:52:14 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2020-08-20 12:16:53 -0400 |
commit | 23348e7f313a570c513772a88db7f2741c8242ba (patch) | |
tree | 533378923a35ce3d92119b96adce2cf77a5b32ef /pkg/spec | |
parent | dbcb6f5892852ecf846faeef10d9b0237c472f99 (diff) | |
download | podman-23348e7f313a570c513772a88db7f2741c8242ba.tar.gz podman-23348e7f313a570c513772a88db7f2741c8242ba.tar.bz2 podman-23348e7f313a570c513772a88db7f2741c8242ba.zip |
Ensure DefaultEnvVariables is used in Specgen
When we rewrote Podman's pkg/spec, one of the things that was
lost was our use of a set of default environment variables, that
ensure all containers have at least $PATH and $TERM set.
While we're in the process of re-adding it, change it from a
variable to a function, so we can ensure the Join function does
not overwrite it and corrupt the defaults.
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'pkg/spec')
-rw-r--r-- | pkg/spec/spec.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/spec/spec.go b/pkg/spec/spec.go index b974772d5..0dbdc76bb 100644 --- a/pkg/spec/spec.go +++ b/pkg/spec/spec.go @@ -321,13 +321,13 @@ func (config *CreateConfig) createConfigToOCISpec(runtime *libpod.Runtime, userM // config. var defaultEnv map[string]string if runtimeConfig == nil { - defaultEnv = env.DefaultEnvVariables + defaultEnv = env.DefaultEnvVariables() } else { defaultEnv, err = env.ParseSlice(runtimeConfig.Containers.Env) if err != nil { return nil, errors.Wrap(err, "Env fields in containers.conf failed ot parse") } - defaultEnv = env.Join(env.DefaultEnvVariables, defaultEnv) + defaultEnv = env.Join(env.DefaultEnvVariables(), defaultEnv) } if err := addRlimits(config, &g); err != nil { |