From d6a4ee3c7d38994b4a553f993d9c75ef01caca30 Mon Sep 17 00:00:00 2001 From: Vincent Demeester Date: Fri, 11 Nov 2016 15:34:01 +0100 Subject: [PATCH] =?UTF-8?q?Add=20reference=20filter=20and=20deprecated=20f?= =?UTF-8?q?ilter=20param=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … for `docker images`. This deprecates the `filter` param for the `/images` endpoint and make a new filter called `reference` to replace it. It does change the CLI side (still possible to do `docker images busybox:musl`) but changes the cli code to use the filter instead (so that `docker images --filter busybox:musl` and `docker images busybox:musl` act the same). Signed-off-by: Vincent Demeester Upstream-commit: 3c61af0f76bcf2ff0342f01c09bef771fbd567f6 Component: cli --- components/cli/command/image/list.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/components/cli/command/image/list.go b/components/cli/command/image/list.go index 587869fdf1..679604fc02 100644 --- a/components/cli/command/image/list.go +++ b/components/cli/command/image/list.go @@ -60,10 +60,14 @@ func newListCommand(dockerCli *command.DockerCli) *cobra.Command { func runImages(dockerCli *command.DockerCli, opts imagesOptions) error { ctx := context.Background() + filters := opts.filter.Value() + if opts.matchName != "" { + filters.Add("reference", opts.matchName) + } + options := types.ImageListOptions{ - MatchName: opts.matchName, - All: opts.all, - Filters: opts.filter.Value(), + All: opts.all, + Filters: filters, } images, err := dockerCli.Client().ImageList(ctx, options)