summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorQi Wang <qiwan@redhat.com>2019-07-29 16:44:09 -0400
committerQi Wang <qiwan@redhat.com>2019-07-30 12:02:18 -0400
commit2da86bdc3a626f3aebaadbf28c5cc73f80995a78 (patch)
treef3a2b7b54fd52f3649d07f5b7aabddc0ae2f3780 /cmd
parentc3c45f3ba5c2782be9658a33f8632467a06c6422 (diff)
downloadpodman-2da86bdc3a626f3aebaadbf28c5cc73f80995a78.tar.gz
podman-2da86bdc3a626f3aebaadbf28c5cc73f80995a78.tar.bz2
podman-2da86bdc3a626f3aebaadbf28c5cc73f80995a78.zip
Set -env variables as appropriate
close #3648 podman create and podman run do not set --env variable if the environment is not present with a value Signed-off-by: Qi Wang <qiwan@redhat.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/shared/parse/parse.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd/podman/shared/parse/parse.go b/cmd/podman/shared/parse/parse.go
index 9fbc92fc3..3a75ff7a8 100644
--- a/cmd/podman/shared/parse/parse.go
+++ b/cmd/podman/shared/parse/parse.go
@@ -126,8 +126,9 @@ func parseEnv(env map[string]string, line string) error {
}
} else {
// if only a pass-through variable is given, clean it up.
- val, _ := os.LookupEnv(name)
- env[name] = val
+ if val, ok := os.LookupEnv(name); ok {
+ env[name] = val
+ }
}
}
return nil