Skip to content

api: remove / internalize LegacyDiskUsage#51437

Merged
robmry merged 1 commit intomoby:masterfrom
thaJeztah:diskusage_move_legacy
Nov 10, 2025
Merged

api: remove / internalize LegacyDiskUsage#51437
robmry merged 1 commit intomoby:masterfrom
thaJeztah:diskusage_move_legacy

Conversation

@thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Nov 7, 2025


api: remove / internalize LegacyDiskUsage

These fields have been removed from the API specification, and the struct
was only needed to produce legacy responses (server), or to unmarshal
legacy responses in the client.

As the API module only provides API definitions for the current API version,
we should remove these legacy structs, and keep them internal to the daemon
and client.

- Human readable description for the release notes

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

These fields have been removed from the API specification, and the struct
was only needed to produce legacy responses (server), or to unmarshal
legacy responses in the client.

As the API module only provides API definitions for the current API version,
we should remove these legacy structs, and keep them internal to the daemon
and client.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah force-pushed the diskusage_move_legacy branch from a62598d to ed42823 Compare November 7, 2025 19:16
@thaJeztah thaJeztah marked this pull request as ready for review November 7, 2025 19:20
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.

Considering that legacy fields are still returned if the verbose is not true, shouldn't we leave this for v1.53?

@thaJeztah
Copy link
Member Author

That's the tricky bit; we won't be able to remove it anymore once we have a v1.x release. If I'm not mistaken we already removed the legacy fields from the API definition, so effectively they're un-documented fields that are no longer part of the API;

moby/api/swagger.yaml

Lines 10488 to 10506 in a0e4deb

/system/df:
get:
summary: "Get data usage information"
operationId: "SystemDataUsage"
responses:
200:
description: "no error"
schema:
type: "object"
title: "SystemDataUsageResponse"
properties:
ImagesDiskUsage:
$ref: "#/definitions/ImagesDiskUsage"
ContainersDiskUsage:
$ref: "#/definitions/ContainersDiskUsage"
VolumesDiskUsage:
$ref: "#/definitions/VolumesDiskUsage"
BuildCacheDiskUsage:
$ref: "#/definitions/BuildCacheDiskUsage"

Given that both the API and Client are a new module, and the client (with this change) doesn't depend on the struct to be present, this allows us to phase out the legacy fields once API < v1.52 support is dropped.

Perhaps we should even consider already omitting the fields in API v1.52; I THINK the only reason we currently still include it is because we didn't have time yet to look at docker-py to see why it even uses an API version it was not written for (and doesn't downgrade to an older API version).

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.

ok

Comment on lines +81 to +82
`verbose` query parameter is used. Starting with API v1.53, the legacy fields
will no longer be returned.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we tie removal of the legacy fields to a release of the daemon rather than an API version? (If we find an issue, we might bump the API version quite soon in a minor/patch release, but should probably carry this forward to a major release?)

Copy link
Member Author

Choose a reason for hiding this comment

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

If needed, we could extend the grace-period of course. It's a bit of an odd-one-out overall; effectively, the fields have already been removed from the API, so API v1.52 should already omit them (and no longer defines them), so from that perspective, perhaps the API changelog should not document the fallback behavior at all (and it's mostly an implementation-specific fallback, where the dockerd daemon chose to provide a grace-period).

Not sure what the best place is to document that though; perhaps in deprecated.md (CLI repo)?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok - when we do drop the fields, after Docker release notes, I guess the API changelog will be where people look to see why their stuff broke. So, SGTM.

@robmry robmry merged commit 69c4524 into moby:master Nov 10, 2025
218 of 220 checks passed
@thaJeztah thaJeztah deleted the diskusage_move_legacy branch November 10, 2025 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants