summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnders F Björklund <anders.f.bjorklund@gmail.com>2018-12-30 18:01:50 +0100
committerAnders F Björklund <anders.f.bjorklund@gmail.com>2019-01-07 21:07:23 +0100
commit83ac4f8277e4076bc8c12263dd634183f7a4bfbd (patch)
treef677f7d7648632d7ff240d6a88596bfb02e24f36
parent8c8d895d66f4bebe004463f77298a20a726b6690 (diff)
downloadpodman-83ac4f8277e4076bc8c12263dd634183f7a4bfbd.tar.gz
podman-83ac4f8277e4076bc8c12263dd634183f7a4bfbd.tar.bz2
podman-83ac4f8277e4076bc8c12263dd634183f7a4bfbd.zip
Honor image environment variables with exec
Was reading the "env" argument twice instead of image. Closes #2063 Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
-rw-r--r--cmd/podman/exec.go11
1 files changed, 1 insertions, 10 deletions
diff --git a/cmd/podman/exec.go b/cmd/podman/exec.go
index 1dcb88dbd..c03834dea 100644
--- a/cmd/podman/exec.go
+++ b/cmd/podman/exec.go
@@ -3,7 +3,6 @@ package main
import (
"fmt"
"os"
- "strings"
"github.com/containers/libpod/cmd/podman/libpodruntime"
"github.com/containers/libpod/libpod"
@@ -99,15 +98,7 @@ func execCmd(c *cli.Context) error {
}
// ENVIRONMENT VARIABLES
- env := defaultEnvVariables
- for _, e := range c.StringSlice("env") {
- split := strings.SplitN(e, "=", 2)
- if len(split) > 1 {
- env[split[0]] = split[1]
- } else {
- env[split[0]] = ""
- }
- }
+ env := map[string]string{}
if err := readKVStrings(env, []string{}, c.StringSlice("env")); err != nil {
return errors.Wrapf(err, "unable to process environment variables")