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>
This commit is contained in:
Justin Chadwell 2022-08-02 12:11:41 +01:00
parent f360088ae7
commit febcc25d1a

View File

@ -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: