From 2da86bdc3a626f3aebaadbf28c5cc73f80995a78 Mon Sep 17 00:00:00 2001
From: Qi Wang <qiwan@redhat.com>
Date: Mon, 29 Jul 2019 16:44:09 -0400
Subject: 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>
---
 cmd/podman/shared/parse/parse.go | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'cmd')

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
-- 
cgit v1.2.3-54-g00ecf