diff options
author | Jakub Guzik <jakubmguzik@gmail.com> | 2021-06-03 22:48:43 +0200 |
---|---|---|
committer | Jakub Guzik <jakubmguzik@gmail.com> | 2021-06-08 15:18:00 +0200 |
commit | a5ad36c65ea07d839fd9bf55a820c8cb9884eed1 (patch) | |
tree | 54f8725dccf2ec1f313ab3f775293e14a4def747 /test/e2e/images_test.go | |
parent | 9a3a7327fdafaac66c99130a6729e4bcde8df0b0 (diff) | |
download | podman-a5ad36c65ea07d839fd9bf55a820c8cb9884eed1.tar.gz podman-a5ad36c65ea07d839fd9bf55a820c8cb9884eed1.tar.bz2 podman-a5ad36c65ea07d839fd9bf55a820c8cb9884eed1.zip |
Fix image prune --filter cmd behavior
Image prune --filter is fully implemented in the api, http api
yet not connected with the cli execution. User trying to use
filters does not see the effect. This commit adds glue code to enable
possiblity of using --filter in prune in the cli execution.
Signed-off-by: Jakub Guzik <jakubmguzik@gmail.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 f6321ec1c..b4ec7447e 100644 --- a/test/e2e/images_test.go +++ b/test/e2e/images_test.go @@ -425,4 +425,25 @@ LABEL "com.example.vendor"="Example Vendor" Expect(result.OutputToStringArray()).To(Not(Equal(result1.OutputToStringArray()))) }) + It("podman image prune --filter", 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{"image", "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)) + + }) + }) |