diff options
author | Sebastiaan van Stijn <github@gone.nl> | 2023-04-17 13:21:59 +0200 |
---|---|---|
committer | Sebastiaan van Stijn <github@gone.nl> | 2023-05-06 16:35:00 +0200 |
commit | 913b0f51cab18a56247a950f5f1e75ca79b63039 (patch) | |
tree | e9ce8c51d9d7a5541ed79aa6497ad2fcc7c7ca25 /daemon | |
parent | 88f4bf4ae4bace73608b73df9fb974081d2bed1a (diff) | |
download | docker-913b0f51cab18a56247a950f5f1e75ca79b63039.tar.gz |
API: omit deprecated VirtualSize field for API v1.44 and up
This field is deprecated since 1261fe69a3586bb102182aa885197822419c768c,
and will now be omitted on API v1.44 and up for the `GET /images/json`,
`GET /images/{id}/json`, and `GET /system/df` endpoints.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/containerd/image_list.go | 1 | ||||
-rw-r--r-- | daemon/images/image_list.go | 9 |
2 files changed, 4 insertions, 6 deletions
diff --git a/daemon/containerd/image_list.go b/daemon/containerd/image_list.go index 72cca0d18a..2110c91069 100644 --- a/daemon/containerd/image_list.go +++ b/daemon/containerd/image_list.go @@ -250,7 +250,6 @@ func (i *ImageService) singlePlatformImage(ctx context.Context, contentStore con RepoDigests: repoDigests, RepoTags: repoTags, Size: totalSize, - VirtualSize: totalSize, //nolint:staticcheck // ignore SA1019: field is deprecated, but still set on API < v1.44. // -1 indicates that the value has not been set (avoids ambiguity // between 0 (default) and "not set". We cannot use a pointer (nil) // for this, as the JSON representation uses "omitempty", which would diff --git a/daemon/images/image_list.go b/daemon/images/image_list.go index 1c3331c8b7..00161434c4 100644 --- a/daemon/images/image_list.go +++ b/daemon/images/image_list.go @@ -257,11 +257,10 @@ func (i *ImageService) Images(ctx context.Context, opts types.ImageListOptions) func newImageSummary(image *image.Image, size int64) *types.ImageSummary { summary := &types.ImageSummary{ - ParentID: image.Parent.String(), - ID: image.ID().String(), - Created: image.Created.Unix(), - Size: size, - VirtualSize: size, //nolint:staticcheck // ignore SA1019: field is deprecated, but still set on API < v1.44. + ParentID: image.Parent.String(), + ID: image.ID().String(), + Created: image.Created.Unix(), + Size: size, // -1 indicates that the value has not been set (avoids ambiguity // between 0 (default) and "not set". We cannot use a pointer (nil) // for this, as the JSON representation uses "omitempty", which would |