mirror of
https://github.com/containers/podman.git
synced 2025-12-02 11:08:36 +08:00
podman: run --replace prints only the new container id
print only the new container ID when using --replace instead of the terminated container ID if it was stopped. Closes: https://github.com/containers/podman/issues/20185 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@@ -1615,9 +1615,12 @@ VOLUME %s`, ALPINE, volPath, volPath)
|
||||
// Run and replace 5 times in a row the "same" container.
|
||||
ctrName := "testCtr"
|
||||
for i := 0; i < 5; i++ {
|
||||
session := podmanTest.Podman([]string{"run", "--detach", "--replace", "--name", ctrName, ALPINE, "/bin/sh"})
|
||||
session := podmanTest.Podman([]string{"run", "--detach", "--replace", "--name", ctrName, ALPINE, "top"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(ExitCleanly())
|
||||
|
||||
// make sure Podman prints only one ID
|
||||
Expect(session.OutputToString()).To(HaveLen(64))
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user