From 348f2df0c09e2e3b517add5271e6eee583800be3 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Mon, 5 Oct 2020 16:33:09 -0400 Subject: Support max_size logoptions Docker supports log-opt max_size and so does conmon (ALthough poorly). Adding support for this allows users to at least make sure their containers logs do not become a DOS vector. Signed-off-by: Daniel J Walsh --- test/e2e/logs_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/e2e/logs_test.go') diff --git a/test/e2e/logs_test.go b/test/e2e/logs_test.go index 67ab71d20..9b3163856 100644 --- a/test/e2e/logs_test.go +++ b/test/e2e/logs_test.go @@ -321,4 +321,20 @@ var _ = Describe("Podman logs", func() { results.WaitWithDefaultTimeout() Expect(results).To(Exit(0)) }) + + It("using container with container log-size", func() { + logc := podmanTest.Podman([]string{"run", "--log-opt=max-size=10k", "-d", ALPINE, "sh", "-c", "echo podman podman podman"}) + logc.WaitWithDefaultTimeout() + Expect(logc).To(Exit(0)) + cid := logc.OutputToString() + + wait := podmanTest.Podman([]string{"wait", cid}) + wait.WaitWithDefaultTimeout() + Expect(wait).To(Exit(0)) + + results := podmanTest.Podman([]string{"logs", cid}) + results.WaitWithDefaultTimeout() + Expect(results).To(Exit(0)) + Expect(results.OutputToString()).To(Equal("podman podman podman")) + }) }) -- cgit v1.2.3-54-g00ecf