From 9d3667c2f025e1e36f3fdbd7348e0e14d00e336d Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Thu, 16 Jan 2020 15:46:39 +0100 Subject: systemdgen: add --ignore flag to generic services The --ignore flag lets Podman ignore errors when a specified container does not exist (anymore). That's a nice addition to generic services generated via the --new flag. Those services create new containers and can hence allows user to manually remove a container; may it only be by accident. The important part of using the --ignore flag is that Podman will exit 0 which plays nicer with most restart policies; a non-zero exit may yield systemd to restart the entire service which is arguably wrong if the user manually deletes the container. If desired, users can still alter the generated files. Signed-off-by: Valentin Rothberg --- test/e2e/generate_systemd_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/e2e') diff --git a/test/e2e/generate_systemd_test.go b/test/e2e/generate_systemd_test.go index f0fef41a4..d0dadd09d 100644 --- a/test/e2e/generate_systemd_test.go +++ b/test/e2e/generate_systemd_test.go @@ -191,7 +191,7 @@ var _ = Describe("Podman generate systemd", func() { found, _ := session.GrepString("# container-foo.service") Expect(found).To(BeTrue()) - found, _ = session.GrepString("stop --cidfile /%t/%n-cid -t 42") + found, _ = session.GrepString("stop --ignore --cidfile /%t/%n-cid -t 42") Expect(found).To(BeTrue()) }) -- cgit v1.2.3-54-g00ecf