From 10bc6233bb621bdc4971ae1da234208b1936d4cc Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Wed, 31 Mar 2021 07:37:36 -0400 Subject: [PATCH] Fix handling of remove --log-rusage param Fixes: https://github.com/containers/podman/issues/9889 Signed-off-by: Daniel J Walsh --- pkg/api/handlers/compat/images_build.go | 1 + test/e2e/build_test.go | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/pkg/api/handlers/compat/images_build.go b/pkg/api/handlers/compat/images_build.go index 5b8741e89d..52012cde81 100644 --- a/pkg/api/handlers/compat/images_build.go +++ b/pkg/api/handlers/compat/images_build.go @@ -350,6 +350,7 @@ func BuildImage(w http.ResponseWriter, r *http.Request) { Jobs: &jobs, Labels: labels, Layers: query.Layers, + LogRusage: query.LogRusage, Manifest: query.Manifest, MaxPullPushRetries: 3, NamespaceOptions: nsoptions, diff --git a/test/e2e/build_test.go b/test/e2e/build_test.go index 95ed23313b..4f337116ea 100644 --- a/test/e2e/build_test.go +++ b/test/e2e/build_test.go @@ -549,4 +549,21 @@ RUN echo hello`, ALPINE) inspect.WaitWithDefaultTimeout() Expect(inspect.OutputToString()).To(Equal("1970-01-01 00:00:00 +0000 UTC")) }) + + It("podman build --log-rusage", func() { + targetPath, err := CreateTempDirInTempDir() + Expect(err).To(BeNil()) + + containerFile := filepath.Join(targetPath, "Containerfile") + content := `FROM scratch` + + Expect(ioutil.WriteFile(containerFile, []byte(content), 0755)).To(BeNil()) + + session := podmanTest.Podman([]string{"build", "--log-rusage", "--pull-never", targetPath}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + Expect(session.OutputToString()).To(ContainSubstring("(system)")) + Expect(session.OutputToString()).To(ContainSubstring("(user)")) + Expect(session.OutputToString()).To(ContainSubstring("(elapsed)")) + }) })