mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
api/types/system: add type specific usage fields to DiskUsage
This change adds type specific fields to `GET /system/df` endpoint with high level information of disk usage. This change also introduces `verbose` query to the endpoint so that detailed information is by default excluded unless queried to reduce memory consumption. The previous top level `DiskUsage` fields (`Images`, `Containers`, `Volumes` and `BuildCache`) are now deprecated and kept for backwards compatibility. Co-authored-by: Claude <noreply@anthropic.com> Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
This commit is contained in:
@@ -29,6 +29,17 @@ func assertRequest(req *http.Request, expMethod string, expectedPath string) err
|
||||
return nil
|
||||
}
|
||||
|
||||
func assertRequestWithQuery(req *http.Request, expMethod string, expectedPath string, expectedQuery string) error {
|
||||
if err := assertRequest(req, expMethod, expectedPath); err != nil {
|
||||
return err
|
||||
}
|
||||
q := req.URL.Query().Encode()
|
||||
if q != expectedQuery {
|
||||
return fmt.Errorf("expected query '%s', got '%s'", expectedQuery, q)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ensureBody makes sure the response has a Body, using [http.NoBody] if
|
||||
// none is present, and returns it as a testRoundTripper.
|
||||
func ensureBody(f func(req *http.Request) (*http.Response, error)) testRoundTripper {
|
||||
|
||||
Reference in New Issue
Block a user