summaryrefslogtreecommitdiff
path: root/cmd/podman/common/specgen.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-05-07 21:44:47 +0200
committerGitHub <noreply@github.com>2020-05-07 21:44:47 +0200
commitab518cdba02b85a32d3c2bce4c0b65dcdea4dfcc (patch)
tree916c768fca45b5e809f9e941b5425e760dcfe08c /cmd/podman/common/specgen.go
parent1d3cdf9a4642df073becb54d178d6b1959526a47 (diff)
parent99bdafba999078bb5763c65cf7dfe7df520030f7 (diff)
downloadpodman-ab518cdba02b85a32d3c2bce4c0b65dcdea4dfcc.tar.gz
podman-ab518cdba02b85a32d3c2bce4c0b65dcdea4dfcc.tar.bz2
podman-ab518cdba02b85a32d3c2bce4c0b65dcdea4dfcc.zip
Merge pull request #6115 from rhatdan/env
podman: split env variables in env and overrides
Diffstat (limited to 'cmd/podman/common/specgen.go')
-rw-r--r--cmd/podman/common/specgen.go13
1 files changed, 5 insertions, 8 deletions
diff --git a/cmd/podman/common/specgen.go b/cmd/podman/common/specgen.go
index 3e9772576..9a2345064 100644
--- a/cmd/podman/common/specgen.go
+++ b/cmd/podman/common/specgen.go
@@ -335,15 +335,12 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string
env = envLib.Join(env, fileEnv)
}
- // env overrides any previous variables
- if cmdLineEnv := c.env; len(cmdLineEnv) > 0 {
- parsedEnv, err := envLib.ParseSlice(cmdLineEnv)
- if err != nil {
- return err
- }
- env = envLib.Join(env, parsedEnv)
+ parsedEnv, err := envLib.ParseSlice(c.Env)
+ if err != nil {
+ return err
}
- s.Env = env
+
+ s.Env = envLib.Join(env, parsedEnv)
// LABEL VARIABLES
labels, err := parse.GetAllLabels(c.LabelFile, c.Label)