mirror of https://github.com/docker/cli.git
Add reference filter and deprecated filter param…
… 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 <vincent@sbr.pm>
This commit is contained in:
parent
19c8941f2f
commit
3c61af0f76
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue