diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2019-04-16 06:26:47 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2019-04-17 15:44:50 -0400 |
commit | 6b3d4abb07bd15f6ca2c2f1dc007c325b9cc0dc4 (patch) | |
tree | 3de71a729e637b94a4dc2e802b7f84f3692afc99 /test/e2e/commit_test.go | |
parent | bf5ffdafb40f32fac891a8cd5fc64cfd5b77674f (diff) | |
download | podman-6b3d4abb07bd15f6ca2c2f1dc007c325b9cc0dc4.tar.gz podman-6b3d4abb07bd15f6ca2c2f1dc007c325b9cc0dc4.tar.bz2 podman-6b3d4abb07bd15f6ca2c2f1dc007c325b9cc0dc4.zip |
Fix podman command --change CMD
Currently in Docker if you commit with --change 'CMD a b c'
The command that gets added is
[/bin/sh -c "a b c"]
If you commit --change 'CMD ["a","b","c"]'
You get
[a b c]
This patch set makes podman match this behaviour.
Similar change required for Entrypoint.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'test/e2e/commit_test.go')
-rw-r--r-- | test/e2e/commit_test.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/e2e/commit_test.go b/test/e2e/commit_test.go index 93e1ea7af..3ece4887e 100644 --- a/test/e2e/commit_test.go +++ b/test/e2e/commit_test.go @@ -117,6 +117,31 @@ var _ = Describe("Podman commit", func() { Expect(foundBlue).To(Equal(true)) }) + It("podman commit container with change CMD flag", func() { + test := podmanTest.Podman([]string{"run", "--name", "test1", "-d", ALPINE, "ls"}) + test.WaitWithDefaultTimeout() + Expect(test.ExitCode()).To(Equal(0)) + Expect(podmanTest.NumberOfContainers()).To(Equal(1)) + + session := podmanTest.Podman([]string{"commit", "--change", "CMD a b c", "test1", "foobar.com/test1-image:latest"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + + session = podmanTest.Podman([]string{"inspect", "--format", "{{.Config.Cmd}}", "foobar.com/test1-image:latest"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + Expect(session.OutputToString()).To(ContainSubstring("sh -c a b c")) + + session = podmanTest.Podman([]string{"commit", "--change", "CMD=[\"a\",\"b\",\"c\"]", "test1", "foobar.com/test1-image:latest"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + + session = podmanTest.Podman([]string{"inspect", "--format", "{{.Config.Cmd}}", "foobar.com/test1-image:latest"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + Expect(session.OutputToString()).To(Not(ContainSubstring("sh -c"))) + }) + It("podman commit container with pause flag", func() { _, ec, _ := podmanTest.RunLsContainer("test1") Expect(ec).To(Equal(0)) |