Skip to content

du: pass until filter as DiskUsage age limit (#4220) - #4221

Open
Yshuro wants to merge 1 commit into
docker:masterfrom
Yshuro:fix/du-filter-until-age-limit
Open

Yshuro wants to merge 1 commit into
docker:masterfrom
Yshuro:fix/du-filter-until-age-limit

Conversation

@Yshuro

@Yshuro Yshuro commented Nov 19, 2026

Copy link
Copy Markdown

Fixes #4220.

What

When running docker buildx du --filter until=<duration> (or --filter unused-for=<duration>), the until filter was converted by toBuildkitPruneInfo into pi.KeepDuration, but c.DiskUsage was only called with client.WithFilter(pi.Filter), discarding the parsed duration and causing du to return all records as if no time filter was provided.

This PR passes client.WithAgeLimit(pi.KeepDuration) into c.DiskUsage when a non-zero KeepDuration is specified, aligning buildx du with BuildKit's DiskUsage API (AgeLimit).

Tests

  • Added TestToDiskUsageOptions verifying that WithAgeLimit is applied when KeepDuration > 0 and omitted when 0.
  • Added TestToBuildkitPruneInfoUntilFilter checking until, unused-for, conflict detection, and combined filters.
  • Added testDiskusageFilterUntil in tests/diskusage.go.
  • All tests in ./commands/... pass cleanly.

Signed-off-by: Sami Chergui <83331159+Yshuro@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make docker buildx du pass the until filter as a DiskUsage age limit

1 participant