mirror of https://github.com/docker/cli.git
Merge pull request #27872 from vdemeester/images-filter-filters
Add reference filter and deprecated filter param…
This commit is contained in:
commit
356ff43768
|
@ -60,10 +60,14 @@ func newListCommand(dockerCli *command.DockerCli) *cobra.Command {
|
||||||
func runImages(dockerCli *command.DockerCli, opts imagesOptions) error {
|
func runImages(dockerCli *command.DockerCli, opts imagesOptions) error {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
|
filters := opts.filter.Value()
|
||||||
|
if opts.matchName != "" {
|
||||||
|
filters.Add("reference", opts.matchName)
|
||||||
|
}
|
||||||
|
|
||||||
options := types.ImageListOptions{
|
options := types.ImageListOptions{
|
||||||
MatchName: opts.matchName,
|
All: opts.all,
|
||||||
All: opts.all,
|
Filters: filters,
|
||||||
Filters: opts.filter.Value(),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
images, err := dockerCli.Client().ImageList(ctx, options)
|
images, err := dockerCli.Client().ImageList(ctx, options)
|
||||||
|
|
Loading…
Reference in New Issue