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.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-11-07 17:14:33 +01:00
parent 4dc87c55c7
commit ed428234bd
8 changed files with 104 additions and 87 deletions

View File

@@ -139,11 +139,9 @@ func TestLegacyDiskUsage(t *testing.T) {
return nil, err
}
return mockJSONResponse(http.StatusOK, nil, system.DiskUsage{
LegacyDiskUsage: system.LegacyDiskUsage{
LayersSize: 4096,
Images: []image.Summary{},
},
return mockJSONResponse(http.StatusOK, nil, &legacyDiskUsage{
LayersSize: 4096,
Images: []image.Summary{},
})(req)
}))
assert.NilError(t, err)