summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-03-07 06:29:00 -0500
committerGitHub <noreply@github.com>2022-03-07 06:29:00 -0500
commit87d911aca97a824728e499c8590e20e8528e24d5 (patch)
tree07f2821cdf207b804c850efaf0b4f7fe1221e1a7 /test
parentf4d6e8777213880204ccbce92201c47c74b33036 (diff)
parentd302c08cffb2c696c8afe7282d16c01a120db85a (diff)
downloadpodman-87d911aca97a824728e499c8590e20e8528e24d5.tar.gz
podman-87d911aca97a824728e499c8590e20e8528e24d5.tar.bz2
podman-87d911aca97a824728e499c8590e20e8528e24d5.zip
Merge pull request #13423 from umohnani8/kube
Throw an error if kube yaml has duplicate ctr names
Diffstat (limited to 'test')
-rw-r--r--test/e2e/play_kube_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/e2e/play_kube_test.go b/test/e2e/play_kube_test.go
index 9b1e0c74b..6a4083565 100644
--- a/test/e2e/play_kube_test.go
+++ b/test/e2e/play_kube_test.go
@@ -1888,6 +1888,26 @@ var _ = Describe("Podman play kube", func() {
Expect(kube).Should(Exit(0))
})
+ It("podman play kube test duplicate container name", func() {
+ p := getPod(withCtr(getCtr(withName("testctr"), withCmd([]string{"echo", "hello"}))), withCtr(getCtr(withName("testctr"), withCmd([]string{"echo", "world"}))))
+
+ err := generateKubeYaml("pod", p, kubeYaml)
+ Expect(err).To(BeNil())
+
+ kube := podmanTest.Podman([]string{"play", "kube", kubeYaml})
+ kube.WaitWithDefaultTimeout()
+ Expect(kube).To(ExitWithError())
+
+ p = getPod(withPodInitCtr(getCtr(withImage(ALPINE), withCmd([]string{"echo", "hello"}), withInitCtr(), withName("initctr"))), withCtr(getCtr(withImage(ALPINE), withName("initctr"), withCmd([]string{"top"}))))
+
+ err = generateKubeYaml("pod", p, kubeYaml)
+ Expect(err).To(BeNil())
+
+ kube = podmanTest.Podman([]string{"play", "kube", kubeYaml})
+ kube.WaitWithDefaultTimeout()
+ Expect(kube).To(ExitWithError())
+ })
+
It("podman play kube test hostname", func() {
pod := getPod()
err := generateKubeYaml("pod", pod, kubeYaml)