prune: fix filter until option

Previously, when specifying the filter option with the until value, no
cache would be cleaned, preventing users from clearing by time. This bug
arises from passing the until field through into buildkit, where, on
filtering, a non-existent field returns false for a match.

The fix is simple, as we build up our list of filters to pass to
buildkit, we skip over the until key, so create a valid list of filters
for buildkit.

Signed-off-by: Justin Chadwell <me@jedevc.com>
pull/1252/head
Justin Chadwell 2 years ago
parent f360088ae7
commit febcc25d1a

@ -176,6 +176,10 @@ func toBuildkitPruneInfo(f filters.Args) (*client.PruneInfo, error) {
bkFilter := make([]string, 0, f.Len())
for _, field := range f.Keys() {
if field == filterKey {
continue
}
values := f.Get(field)
switch len(values) {
case 0:

Loading…
Cancel
Save