summaryrefslogtreecommitdiff
path: root/test/e2e
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2021-09-28 14:12:18 -0400
committerMatthew Heon <matthew.heon@pm.me>2021-09-29 16:39:29 -0400
commit5064fd519cfd09395f9632ecb94492949b7a8367 (patch)
tree0980733659798a8d66b855dd9819bada83230de0 /test/e2e
parentba74d6e6ecc2cc8e1480a466e29a078a93e24afa (diff)
downloadpodman-5064fd519cfd09395f9632ecb94492949b7a8367.tar.gz
podman-5064fd519cfd09395f9632ecb94492949b7a8367.tar.bz2
podman-5064fd519cfd09395f9632ecb94492949b7a8367.zip
Ensure pod ID bucket is properly updated on rename
As we were not updating the pod ID bucket, removing a pod with containers still in it (including the infra container, which will always suffer from this) will not properly update the name registry to remove the name of any renamed containers. This patch ensures that does not happen - all containers will be fully removed, even if renamed. Fixes #11750 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'test/e2e')
-rw-r--r--test/e2e/rename_test.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/e2e/rename_test.go b/test/e2e/rename_test.go
index 0bd1792c9..e5e69c25c 100644
--- a/test/e2e/rename_test.go
+++ b/test/e2e/rename_test.go
@@ -111,4 +111,29 @@ var _ = Describe("podman rename", func() {
Expect(ps).Should(Exit(0))
Expect(ps.OutputToString()).To(ContainSubstring(newName))
})
+
+ It("Rename a container that is part of a pod", func() {
+ podName := "testPod"
+ infraName := "infra1"
+ pod := podmanTest.Podman([]string{"pod", "create", "--name", podName, "--infra-name", infraName})
+ pod.WaitWithDefaultTimeout()
+ Expect(pod).Should(Exit(0))
+
+ infraName2 := "infra2"
+ rename := podmanTest.Podman([]string{"rename", infraName, infraName2})
+ rename.WaitWithDefaultTimeout()
+ Expect(rename).Should(Exit(0))
+
+ remove := podmanTest.Podman([]string{"pod", "rm", "-f", podName})
+ remove.WaitWithDefaultTimeout()
+ Expect(remove).Should(Exit(0))
+
+ create := podmanTest.Podman([]string{"create", "--name", infraName2, ALPINE, "top"})
+ create.WaitWithDefaultTimeout()
+ Expect(create).Should(Exit(0))
+
+ create2 := podmanTest.Podman([]string{"create", "--name", infraName, ALPINE, "top"})
+ create2.WaitWithDefaultTimeout()
+ Expect(create2).Should(Exit(0))
+ })
})