Skip to content

Commit b9e3346

Browse files
authored
Merge pull request #6473 from thaJeztah/28.x_backport_deprecation_preparations
[28.x backport] remove uses of client options that will be deprecated
2 parents 25421ac + 09fcf8e commit b9e3346

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

cli/command/builder/prune.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,12 @@ func runPrune(ctx context.Context, dockerCli command.Cli, options pruneOptions)
8585
}
8686

8787
report, err := dockerCli.Client().BuildCachePrune(ctx, build.CachePruneOptions{
88-
All: options.all,
89-
KeepStorage: options.keepStorage.Value(), // FIXME(thaJeztah): rewrite to use new options; see https://github.com/moby/moby/pull/48720
90-
Filters: pruneFilters,
88+
All: options.all,
89+
// TODO(austinvazquez): remove when updated to use github.com/moby/moby/client@v0.1.0
90+
// See https://github.com/moby/moby/pull/50772 for more details.
91+
KeepStorage: options.keepStorage.Value(),
92+
ReservedSpace: options.keepStorage.Value(),
93+
Filters: pruneFilters,
9194
})
9295
if err != nil {
9396
return 0, "", err

cli/command/cli.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,8 +603,10 @@ func NewDockerCli(ops ...CLIOption) (*DockerCli, error) {
603603
ops = append(defaultOps, ops...)
604604

605605
cli := &DockerCli{baseCtx: context.Background()}
606-
if err := cli.Apply(ops...); err != nil {
607-
return nil, err
606+
for _, op := range ops {
607+
if err := op(cli); err != nil {
608+
return nil, err
609+
}
608610
}
609611
return cli, nil
610612
}

0 commit comments

Comments
 (0)