diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-03-21 04:49:03 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-21 04:49:03 -0700 |
commit | 78244aa6d4725bbf668c0d98896ad726e5bc52e4 (patch) | |
tree | 5ed2a7da8757e1a34fe9b52dcfd4b17aaccf3e8d | |
parent | c230f0c693134830b3df60a8dc37770848a6f5e2 (diff) | |
parent | a53c768409db7cf18c20eab73a24bd193493c9ce (diff) | |
download | podman-78244aa6d4725bbf668c0d98896ad726e5bc52e4.tar.gz podman-78244aa6d4725bbf668c0d98896ad726e5bc52e4.tar.bz2 podman-78244aa6d4725bbf668c0d98896ad726e5bc52e4.zip |
Merge pull request #2717 from giuseppe/fix-env-parse
podman: do not split --env on comma
-rw-r--r-- | cmd/podman/common.go | 2 | ||||
-rw-r--r-- | cmd/podman/exec.go | 2 | ||||
-rw-r--r-- | cmd/podman/shared/create.go | 2 | ||||
-rw-r--r-- | test/e2e/run_test.go | 4 |
4 files changed, 5 insertions, 5 deletions
diff --git a/cmd/podman/common.go b/cmd/podman/common.go index 43dfdb837..8b42ed673 100644 --- a/cmd/podman/common.go +++ b/cmd/podman/common.go @@ -264,7 +264,7 @@ func getCreateFlags(c *cliconfig.PodmanCommand) { "entrypoint", "", "Overwrite the default ENTRYPOINT of the image", ) - createFlags.StringSliceP( + createFlags.StringArrayP( "env", "e", []string{}, "Set environment variables in container", ) diff --git a/cmd/podman/exec.go b/cmd/podman/exec.go index aa81edf56..a6afbf75a 100644 --- a/cmd/podman/exec.go +++ b/cmd/podman/exec.go @@ -41,7 +41,7 @@ func init() { execCommand.SetUsageTemplate(UsageTemplate()) flags := execCommand.Flags() flags.SetInterspersed(false) - flags.StringSliceVarP(&execCommand.Env, "env", "e", []string{}, "Set environment variables") + flags.StringArrayVarP(&execCommand.Env, "env", "e", []string{}, "Set environment variables") flags.BoolVarP(&execCommand.Interfactive, "interactive", "i", false, "Not supported. All exec commands are interactive by default") flags.BoolVarP(&execCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of") flags.BoolVar(&execCommand.Privileged, "privileged", false, "Give the process extended Linux capabilities inside the container. The default is false") diff --git a/cmd/podman/shared/create.go b/cmd/podman/shared/create.go index 32a80e9f9..55eb3ce83 100644 --- a/cmd/podman/shared/create.go +++ b/cmd/podman/shared/create.go @@ -499,7 +499,7 @@ func ParseCreateOpts(ctx context.Context, c *cliconfig.PodmanCommand, runtime *l } } } - if err := parse.ReadKVStrings(env, c.StringSlice("env-file"), c.StringSlice("env")); err != nil { + if err := parse.ReadKVStrings(env, c.StringSlice("env-file"), c.StringArray("env")); err != nil { return nil, errors.Wrapf(err, "unable to process environment variables") } diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go index 9ab4ae563..b0dc66707 100644 --- a/test/e2e/run_test.go +++ b/test/e2e/run_test.go @@ -152,10 +152,10 @@ var _ = Describe("Podman run", func() { }) It("podman run environment test", func() { - session := podmanTest.Podman([]string{"run", "--rm", "--env", "FOO=BAR", ALPINE, "printenv", "FOO"}) + session := podmanTest.Podman([]string{"run", "--rm", "--env", "FOO=BAR,BAZ", ALPINE, "printenv", "FOO"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) - match, _ := session.GrepString("BAR") + match, _ := session.GrepString("BAR,BAZ") Expect(match).Should(BeTrue()) session = podmanTest.Podman([]string{"run", "--rm", "--env", "PATH=/bin", ALPINE, "printenv", "PATH"}) |