diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-09-23 04:27:26 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-23 04:27:26 -0400 |
commit | b0d1c0fe22da27c88a0e5de11de08d63ef861347 (patch) | |
tree | 59558e87e15083dd5ca4ac2a01fd21bd5e61e46c /test/e2e | |
parent | 1dba601b56551b301490b36b198477ee0a58d137 (diff) | |
parent | 45ee5c5db2d67e17f4271fab5f61b7cafb6aea10 (diff) | |
download | podman-b0d1c0fe22da27c88a0e5de11de08d63ef861347.tar.gz podman-b0d1c0fe22da27c88a0e5de11de08d63ef861347.tar.bz2 podman-b0d1c0fe22da27c88a0e5de11de08d63ef861347.zip |
Merge pull request #11704 from rhatdan/kube
podman generate kube should not include images command
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/generate_kube_test.go | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/e2e/generate_kube_test.go b/test/e2e/generate_kube_test.go index bf89a0708..cb556991c 100644 --- a/test/e2e/generate_kube_test.go +++ b/test/e2e/generate_kube_test.go @@ -792,6 +792,45 @@ var _ = Describe("Podman generate kube", func() { Expect(containers[0].Args).To(Equal([]string{"10s"})) }) + It("podman generate kube - no command", func() { + session := podmanTest.Podman([]string{"create", "--name", "test", ALPINE}) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + + kube := podmanTest.Podman([]string{"generate", "kube", "test"}) + kube.WaitWithDefaultTimeout() + Expect(kube).Should(Exit(0)) + + // Now make sure that the container's command is not set to the + // entrypoint and it's arguments to "10s". + pod := new(v1.Pod) + err := yaml.Unmarshal(kube.Out.Contents(), pod) + Expect(err).To(BeNil()) + + containers := pod.Spec.Containers + Expect(len(containers)).To(Equal(1)) + Expect(len(containers[0].Command)).To(Equal(0)) + + cmd := []string{"echo", "hi"} + session = podmanTest.Podman(append([]string{"create", "--name", "test1", ALPINE}, cmd...)) + session.WaitWithDefaultTimeout() + Expect(session).Should(Exit(0)) + + kube = podmanTest.Podman([]string{"generate", "kube", "test1"}) + kube.WaitWithDefaultTimeout() + Expect(kube).Should(Exit(0)) + + // Now make sure that the container's command is not set to the + // entrypoint and it's arguments to "10s". + pod = new(v1.Pod) + err = yaml.Unmarshal(kube.Out.Contents(), pod) + Expect(err).To(BeNil()) + + containers = pod.Spec.Containers + Expect(len(containers)).To(Equal(1)) + Expect(containers[0].Command).To(Equal(cmd)) + }) + It("podman generate kube - use entrypoint from image", func() { // Build an image with an entrypoint. containerfile := `FROM quay.io/libpod/alpine:latest |