From 125202923f00f43fd102760b3340b86dd72a4c7d Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Wed, 17 Oct 2018 09:25:26 +0200 Subject: fix environment variable parsing Fix the parsing of environment variables to catch invalid ones, such as `-e = ` or `-e =A`, early in the stack to return meaningful error messages. Also, instead of erroring out, set unspecified env variables as empty (e.g., `-e FOO`) to remain compatible with Docker. Fixes: #1663 Signed-off-by: Valentin Rothberg --- cmd/podman/create_cli_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/podman/create_cli_test.go') diff --git a/cmd/podman/create_cli_test.go b/cmd/podman/create_cli_test.go index fa128c8e6..9db007ff3 100644 --- a/cmd/podman/create_cli_test.go +++ b/cmd/podman/create_cli_test.go @@ -47,7 +47,7 @@ func TestGetAllLabels(t *testing.T) { } func TestGetAllLabelsBadKeyValue(t *testing.T) { - inLabels := []string{"ONE1", "TWO=2"} + inLabels := []string{"=badValue", "="} fileLabels := []string{} _, err := getAllLabels(fileLabels, inLabels) assert.Error(t, err, assert.AnError) -- cgit v1.2.3-54-g00ecf