Skip to content

Commit

Permalink
User specified environment after other environments are set
Browse files Browse the repository at this point in the history
Users can not currently override the environment variables set by
--http-proxy

Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed Apr 29, 2020
1 parent f44f830 commit cc4a1ea
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/spec/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit cc4a1ea

Please sign in to comment.