From 7d85d8fbeac5b0ab3d09e6a5317bc4c9eaff9516 Mon Sep 17 00:00:00 2001 From: Austin Vazquez Date: Thu, 4 Sep 2025 17:26:07 -0500 Subject: [PATCH] Set `ReservedSpace` field in preparation of `KeepStorage` deprecation This change updates the builder prune command to send the `ReservedSpace` parameter in preparation of `KeepStorage` deprecation in API v1.52. Signed-off-by: Austin Vazquez --- cli/command/builder/prune.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cli/command/builder/prune.go b/cli/command/builder/prune.go index 4cb7b2df019f..337d9fa61c60 100644 --- a/cli/command/builder/prune.go +++ b/cli/command/builder/prune.go @@ -88,9 +88,12 @@ func runPrune(ctx context.Context, dockerCli command.Cli, options pruneOptions) } report, err := dockerCli.Client().BuildCachePrune(ctx, build.CachePruneOptions{ - All: options.all, - KeepStorage: options.keepStorage.Value(), // FIXME(thaJeztah): rewrite to use new options; see https://github.com/moby/moby/pull/48720 - Filters: pruneFilters, + All: options.all, + // TODO(austinvazquez): remove when updated to use github.com/moby/moby/client@v0.1.0 + // See https://github.com/moby/moby/pull/50772 for more details. + KeepStorage: options.keepStorage.Value(), + ReservedSpace: options.keepStorage.Value(), + Filters: pruneFilters, }) if err != nil { return 0, "", err