summaryrefslogtreecommitdiff
path: root/pkg/spec/spec.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-04-28 16:17:14 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2020-04-28 16:29:01 -0400
commite84beeaf94014f6440e0b23f53ba0d1e4015186f (patch)
treed55b91b9a5341953e9cf00dd6833f21f1147dd96 /pkg/spec/spec.go
parentebf041652e93487b8afbac2bc4d9031d8547d866 (diff)
downloadpodman-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/spec/spec.go')
-rw-r--r--pkg/spec/spec.go9
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