From b90f7f90952f16e0c1b05e8f750b56bb43711b5e Mon Sep 17 00:00:00 2001 From: Baron Lenardson Date: Tue, 22 Dec 2020 20:02:08 -0600 Subject: Rework pruning to report reclaimed space This change adds code to report the reclaimed space after a prune. Reclaimed space from volumes, images, and containers is recorded during the prune call in a PruneReport struct. These structs are collected into a slice during a system prune and processed afterwards to calculate the total reclaimed space. Closes #8658 Signed-off-by: Baron Lenardson --- pkg/bindings/test/images_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pkg/bindings/test/images_test.go') diff --git a/pkg/bindings/test/images_test.go b/pkg/bindings/test/images_test.go index e178f4219..c6b9c20f9 100644 --- a/pkg/bindings/test/images_test.go +++ b/pkg/bindings/test/images_test.go @@ -9,6 +9,7 @@ import ( "github.com/containers/podman/v2/pkg/bindings" "github.com/containers/podman/v2/pkg/bindings/containers" "github.com/containers/podman/v2/pkg/bindings/images" + dreports "github.com/containers/podman/v2/pkg/domain/entities/reports" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "github.com/onsi/gomega/gexec" @@ -355,7 +356,7 @@ var _ = Describe("Podman images", func() { results, err := images.Prune(bt.conn, options) Expect(err).NotTo(HaveOccurred()) Expect(len(results)).To(BeNumerically(">", 0)) - Expect(results).To(ContainElement("docker.io/library/alpine:latest")) + Expect(dreports.PruneReportsIds(results)).To(ContainElement("docker.io/library/alpine:latest")) }) // TODO: we really need to extent to pull tests once we have a more sophisticated CI. -- cgit v1.2.3-54-g00ecf