mirror of
https://github.com/docker/cli.git
synced 2026-09-28 02:06:53 -04:00
Merge pull request #27872 from vdemeester/images-filter-filters
Add reference filter and deprecated filter param…
Upstream-commit: 356ff43768
Component: cli
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user