From 0e171b7b3327948f2e9e32d9e496736bd7a48009 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Wed, 10 Jun 2020 14:35:00 -0400 Subject: Do not share container log driver for exec When the container uses journald logging, we don't want to automatically use the same driver for its exec sessions. If we do we will pollute the journal (particularly in the case of healthchecks) with large amounts of undesired logs. Instead, force exec sessions logs to file for now; we can add a log-driver flag later (we'll probably want to add a `podman logs` command that reads exec session logs at the same time). As part of this, add support for the new 'none' logs driver in Conmon. It will be the default log driver for exec sessions, and can be optionally selected for containers. Great thanks to Joe Gooch (mrwizard@dok.org) for adding support to Conmon for a null log driver, and wiring it in here. Fixes #6555 Signed-off-by: Matthew Heon --- test/e2e/exec_test.go | 4 ---- test/e2e/logs_test.go | 11 +++++++++++ 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'test/e2e') diff --git a/test/e2e/exec_test.go b/test/e2e/exec_test.go index b152da9e6..f44d428d6 100644 --- a/test/e2e/exec_test.go +++ b/test/e2e/exec_test.go @@ -25,10 +25,6 @@ var _ = Describe("Podman exec", func() { podmanTest = PodmanTestCreate(tempdir) podmanTest.Setup() podmanTest.SeedImages() - // HACK: Remove this once we get Conmon 2.0.17 on Ubuntu - if podmanTest.Host.Distribution == "ubuntu" { - Skip("Unable to perform test on Ubuntu distributions due to too-old Conmon (need 2.0.17)") - } }) AfterEach(func() { diff --git a/test/e2e/logs_test.go b/test/e2e/logs_test.go index f9446e0c6..f19147662 100644 --- a/test/e2e/logs_test.go +++ b/test/e2e/logs_test.go @@ -300,4 +300,15 @@ var _ = Describe("Podman logs", func() { results.WaitWithDefaultTimeout() Expect(results).To(Exit(0)) }) + + It("podman logs with log-driver=none errors", func() { + ctrName := "logsctr" + logc := podmanTest.Podman([]string{"run", "--name", ctrName, "-d", "--log-driver", "none", ALPINE, "top"}) + logc.WaitWithDefaultTimeout() + Expect(logc).To(Exit(0)) + + logs := podmanTest.Podman([]string{"logs", "-f", ctrName}) + logs.WaitWithDefaultTimeout() + Expect(logs).To(Not(Exit(0))) + }) }) -- cgit v1.2.3-54-g00ecf