Fix handling of remove of bogus volumes, networks and Pods

In podman containers rm and podman images rm, the commands
exit with error code 1 if the object does not exists.

This PR implements similar functionality to volumes, networks, and Pods.

Similarly if volumes or Networks are in use by other containers, and return
exit code 2.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh
2020-09-29 10:05:53 -04:00
parent 12f173f473
commit 22474095ab
17 changed files with 113 additions and 15 deletions

View File

@ -228,11 +228,11 @@ var _ = Describe("Podman rm", func() {
session = podmanTest.Podman([]string{"rm", "bogus", "test1"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(125))
Expect(session.ExitCode()).To(Equal(1))
session = podmanTest.Podman([]string{"rm", "test1", "bogus"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(125))
Expect(session.ExitCode()).To(Equal(1))
})
It("podman rm --ignore bogus container and a running container", func() {