diff options
author | Jhon Honce <jhonce@redhat.com> | 2020-03-26 17:16:59 -0700 |
---|---|---|
committer | Jhon Honce <jhonce@redhat.com> | 2020-03-26 18:32:44 -0700 |
commit | 581dd312af6ada92b96e16dd95d45967bde5fd8a (patch) | |
tree | 13e55270aa70201f5514b769410a736a07b102af /pkg/bindings/images | |
parent | 1710eca4e930f7ed3a2b060029c627c1a66a2349 (diff) | |
download | podman-581dd312af6ada92b96e16dd95d45967bde5fd8a.tar.gz podman-581dd312af6ada92b96e16dd95d45967bde5fd8a.tar.bz2 podman-581dd312af6ada92b96e16dd95d45967bde5fd8a.zip |
V2 podman image prune
* Fixed header for `podman image ls`
* Implemented prune `all` flag, preserved filter method for backwards
capability
* Updated binding tests
Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'pkg/bindings/images')
-rw-r--r-- | pkg/bindings/images/images.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pkg/bindings/images/images.go b/pkg/bindings/images/images.go index e67965042..5e3af7a60 100644 --- a/pkg/bindings/images/images.go +++ b/pkg/bindings/images/images.go @@ -154,7 +154,7 @@ func Export(ctx context.Context, nameOrID string, w io.Writer, format *string, c // Prune removes unused images from local storage. The optional filters can be used to further // define which images should be pruned. -func Prune(ctx context.Context, filters map[string][]string) ([]string, error) { +func Prune(ctx context.Context, all *bool, filters map[string][]string) ([]string, error) { var ( deleted []string ) @@ -163,6 +163,9 @@ func Prune(ctx context.Context, filters map[string][]string) ([]string, error) { return nil, err } params := url.Values{} + if all != nil { + params.Set("all", strconv.FormatBool(*all)) + } if filters != nil { stringFilter, err := bindings.FiltersToString(filters) if err != nil { @@ -174,7 +177,7 @@ func Prune(ctx context.Context, filters map[string][]string) ([]string, error) { if err != nil { return deleted, err } - return deleted, response.Process(nil) + return deleted, response.Process(&deleted) } // Tag adds an additional name to locally-stored image. Both the tag and repo parameters are required. |