mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #42608 from rvolosatovs/fix_builder_size
Deprecate `BuilderSize` in API versions >= 1.42
This commit is contained in:
commit
bf78e25fe5
3 changed files with 12 additions and 5 deletions
|
@ -113,12 +113,14 @@ func (s *systemRouter) getDiskUsage(ctx context.Context, w http.ResponseWriter,
|
|||
return err
|
||||
}
|
||||
|
||||
if versions.LessThan(httputils.VersionFromContext(ctx), "1.42") {
|
||||
var builderSize int64
|
||||
for _, b := range buildCache {
|
||||
builderSize += b.Size
|
||||
}
|
||||
|
||||
du.BuilderSize = builderSize
|
||||
}
|
||||
|
||||
du.BuildCache = buildCache
|
||||
if buildCache == nil {
|
||||
// Ensure empty `BuildCache` field is represented as empty JSON array(`[]`)
|
||||
|
|
|
@ -538,7 +538,7 @@ type DiskUsage struct {
|
|||
Containers []*Container
|
||||
Volumes []*Volume
|
||||
BuildCache []*BuildCache
|
||||
BuilderSize int64 // deprecated
|
||||
BuilderSize int64 `json:",omitempty"` // Deprecated: deprecated in API 1.38, and no longer used since API 1.40.
|
||||
}
|
||||
|
||||
// ContainersPruneReport contains the response for Engine API:
|
||||
|
|
|
@ -17,6 +17,11 @@ keywords: "API, Docker, rcli, REST, documentation"
|
|||
|
||||
[Docker Engine API v1.42](https://docs.docker.com/engine/api/v1.42/) documentation
|
||||
|
||||
* Removed the `BuilderSize` field on the `GET /system/df` endpoint. This field
|
||||
was introduced in API 1.31 as part of an experimental feature, and no longer
|
||||
used since API 1.40.
|
||||
Use field `BuildCache` instead to track storage used by the builder component.
|
||||
|
||||
## v1.41 API changes
|
||||
|
||||
[Docker Engine API v1.41](https://docs.docker.com/engine/api/v1.41/) documentation
|
||||
|
|
Loading…
Reference in a new issue