mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #42716 from rvolosatovs/discard_type_pre_1_42
API: discard `/system/df` `type` parameter pre-1.42
This commit is contained in:
commit
91dc595e96
1 changed files with 5 additions and 2 deletions
|
@ -94,8 +94,11 @@ func (s *systemRouter) getDiskUsage(ctx context.Context, w http.ResponseWriter,
|
|||
return err
|
||||
}
|
||||
|
||||
version := httputils.VersionFromContext(ctx)
|
||||
|
||||
var getContainers, getImages, getVolumes, getBuildCache bool
|
||||
if typeStrs, ok := r.Form["type"]; !ok {
|
||||
typeStrs, ok := r.Form["type"]
|
||||
if versions.LessThan(version, "1.42") || !ok {
|
||||
getContainers, getImages, getVolumes, getBuildCache = true, true, true, true
|
||||
} else {
|
||||
for _, typ := range typeStrs {
|
||||
|
@ -151,7 +154,7 @@ func (s *systemRouter) getDiskUsage(ctx context.Context, w http.ResponseWriter,
|
|||
}
|
||||
|
||||
var builderSize int64
|
||||
if versions.LessThan(httputils.VersionFromContext(ctx), "1.42") {
|
||||
if versions.LessThan(version, "1.42") {
|
||||
for _, b := range buildCache {
|
||||
builderSize += b.Size
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue