c8d/list: Don't setup label filter if it's not specified

Don't run filter function which would only run through the images
reading theirs config without checking any label anyway.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Paweł Gronowski 2024-03-18 10:23:31 +01:00
parent a9bca45e92
commit 6f3892dc99
No known key found for this signature in database
GPG key ID: B85EFCFE26DEF92A

View file

@ -551,6 +551,10 @@ func setupLabelFilter(store content.Store, fltrs filters.Args) (func(image image
}
}
if len(checks) == 0 {
return nil, nil
}
return func(image images.Image) bool {
ctx := context.TODO()