diff options
author | Aditya Rajan <arajan@redhat.com> | 2021-10-12 12:41:07 +0530 |
---|---|---|
committer | Aditya Rajan <arajan@redhat.com> | 2021-10-12 15:31:54 +0530 |
commit | ab8fb3876d25efa2196dbea9d6e07e3ea6493c23 (patch) | |
tree | 97290e0b6f03c30f7b0fe5c5ac95f649d5d9c916 /test/e2e/images_test.go | |
parent | 2fcec59445267e8c8e06005539701a172d3db8a5 (diff) | |
download | podman-ab8fb3876d25efa2196dbea9d6e07e3ea6493c23.tar.gz podman-ab8fb3876d25efa2196dbea9d6e07e3ea6493c23.tar.bz2 podman-ab8fb3876d25efa2196dbea9d6e07e3ea6493c23.zip |
builder: Add support for builder prune
Docker has support for docker builder prune and
docker builder build
This patch will add a hidden command to support scripts using this
syntax. We don't want to encourage this deviation.
Add podman build prune to implement docker builder prune
functionality.
Co-authored-by: Daniel J Walsh <dwalsh@redhat.com>
Signed-off-by: Aditya Rajan <arajan@redhat.com>
Diffstat (limited to 'test/e2e/images_test.go')
-rw-r--r-- | test/e2e/images_test.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/e2e/images_test.go b/test/e2e/images_test.go index b4ec7447e..56af64f04 100644 --- a/test/e2e/images_test.go +++ b/test/e2e/images_test.go @@ -446,4 +446,25 @@ RUN > file2 }) + It("podman builder prune", func() { + dockerfile := `FROM quay.io/libpod/alpine:latest +RUN > file +` + dockerfile2 := `FROM quay.io/libpod/alpine:latest +RUN > file2 +` + podmanTest.BuildImageWithLabel(dockerfile, "foobar.com/workdir:latest", "false", "abc") + podmanTest.BuildImageWithLabel(dockerfile2, "foobar.com/workdir:latest", "false", "xyz") + // --force used to to avoid y/n question + result := podmanTest.Podman([]string{"builder", "prune", "--filter", "label=abc", "--force"}) + result.WaitWithDefaultTimeout() + Expect(result).Should(Exit(0)) + Expect(len(result.OutputToStringArray())).To(Equal(1)) + + //check if really abc is removed + result = podmanTest.Podman([]string{"image", "list", "--filter", "label=abc"}) + Expect(len(result.OutputToStringArray())).To(Equal(0)) + + }) + }) |