Skip to content

[28.x backport] api/types/system: move DiskUsage, DiskUsageOptions to api/types/backend#50545

Merged
thaJeztah merged 1 commit intomoby:28.xfrom
thaJeztah:28.x_fix_backend_types
Jul 28, 2025
Merged

[28.x backport] api/types/system: move DiskUsage, DiskUsageOptions to api/types/backend#50545
thaJeztah merged 1 commit intomoby:28.xfrom
thaJeztah:28.x_fix_backend_types

Conversation

@thaJeztah
Copy link
Member

These types were introduced in f07242f, but while their description mentions it's the type used for the response, it actually isn't, and it's used by the backend, but ultimately marshaled to the "types.DiskUsage" struct;

// Use the old struct for the API return value.
var v types.DiskUsage
if du.Images != nil {
v.LayersSize = du.Images.TotalSize
v.Images = du.Images.Items
}
if du.Containers != nil {
v.Containers = du.Containers.Items
}
if du.Volumes != nil {
v.Volumes = du.Volumes.Items
}
if du.BuildCache != nil {
v.BuildCache = du.BuildCache.Items
}
v.BuilderSize = builderSize
return httputils.WriteJSON(w, http.StatusOK, v)

(cherry picked from commit 82c069c)

- What I did

- How I did it

- How to verify it

- Human readable description for the release notes

- A picture of a cute animal (not mandatory but encouraged)

These types were introduced in f07242f,
but while their description mentions it's the type used for the
response, it actually isn't, and it's used by the backend, but
ultimately marshaled to the "types.DiskUsage" struct;

https://github.com/moby/moby/blob/7dc46c6e0c727a746ecfb8427c0c3cbd998059bc/daemon/server/router/system/system_routes.go#L254-L270

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 82c069c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Copy link
Contributor

@vvoland vvoland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (if green)

@thaJeztah thaJeztah modified the milestones: 29.0.0, 28.4.0 Jul 28, 2025
@thaJeztah thaJeztah merged commit c9c7964 into moby:28.x Jul 28, 2025
197 of 198 checks passed
@thaJeztah thaJeztah deleted the 28.x_fix_backend_types branch July 28, 2025 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants