1
0
Fork 0
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:
Sebastiaan van Stijn 2021-07-12 19:29:22 +02:00 committed by GitHub
commit bf78e25fe5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 5 deletions

View file

@ -113,12 +113,14 @@ func (s *systemRouter) getDiskUsage(ctx context.Context, w http.ResponseWriter,
return err
}
var builderSize int64
for _, b := range buildCache {
builderSize += b.Size
if versions.LessThan(httputils.VersionFromContext(ctx), "1.42") {
var builderSize int64
for _, b := range buildCache {
builderSize += b.Size
}
du.BuilderSize = builderSize
}
du.BuilderSize = builderSize
du.BuildCache = buildCache
if buildCache == nil {
// Ensure empty `BuildCache` field is represented as empty JSON array(`[]`)

View file

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

View file

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