diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2020-04-28 16:17:14 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2020-04-28 16:29:01 -0400 |
commit | e84beeaf94014f6440e0b23f53ba0d1e4015186f (patch) | |
tree | d55b91b9a5341953e9cf00dd6833f21f1147dd96 /pkg | |
parent | ebf041652e93487b8afbac2bc4d9031d8547d866 (diff) | |
download | podman-e84beeaf94014f6440e0b23f53ba0d1e4015186f.tar.gz podman-e84beeaf94014f6440e0b23f53ba0d1e4015186f.tar.bz2 podman-e84beeaf94014f6440e0b23f53ba0d1e4015186f.zip |
User specified environment happen after other environments are set
When using varlink we want to make sure that user specified environment variables
take precedence over http-proxy environment.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/spec/spec.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pkg/spec/spec.go b/pkg/spec/spec.go index 7ee2df890..a62344640 100644 --- a/pkg/spec/spec.go +++ b/pkg/spec/spec.go @@ -326,10 +326,6 @@ func (config *CreateConfig) createConfigToOCISpec(runtime *libpod.Runtime, userM } defaultEnv = env.Join(env.DefaultEnvVariables, defaultEnv) } - config.Env = env.Join(defaultEnv, config.Env) - for name, val := range config.Env { - g.AddProcessEnv(name, val) - } if err := addRlimits(config, &g); err != nil { return nil, err @@ -360,6 +356,11 @@ func (config *CreateConfig) createConfigToOCISpec(runtime *libpod.Runtime, userM if err := config.Cgroup.ConfigureGenerator(&g); err != nil { return nil, err } + + config.Env = env.Join(defaultEnv, config.Env) + for name, val := range config.Env { + g.AddProcessEnv(name, val) + } configSpec := g.Config // If the container image specifies an label with a |