8000 api: move "DiskUsage" related types to the right location by thaJeztah · Pull Request #50518 · moby/moby · GitHub
[go: up one dir, main page]

Skip to content

Conversation

thaJeztah
Copy link
Member

api/types/system: move DiskUsage, DiskUsageOptions to api/types/backend

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)

api/types: move DiskUsage types to api/types/system

Now that the types for the backend were moved to api/types/backend,
we can move the actual response-type and related options to
api/types/system.

client: rename files for system-commands to their canonical name

It took me some time to find these commands because they were not named
after their canonical name, unlike (most) other commands.

- Human readable description for the release notes

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

@thaJeztah thaJeztah added this to the 29.0.0 milestone Jul 25, 2025
@thaJeztah thaJeztah added area/api API status/2-code-review kind/refactor PR's that refactor, or clean-up code release-blocker PRs we want to block a release on labels Jul 25, 2025
@thaJeztah
Copy link
Member Author

FWIW, maybe the intent was to also change the API response, but it didn't, and it we would, we can add these types to types/system with some other name.

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>
Now that the types for the backend were moved to api/types/backend,
we can move the actual response-type and related options to
api/types/system.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
It took me some time to find these commands because they were not named
after their canonical name, unlike (most) other commands.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api API kind/refactor PR's that refactor, or clean-up code release-blocker PRs we want to block a release on status/2-code-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0