containerd integration: verify "Size" vs "VirtualSize" in images #43862
Labels
area/images
containerd-integration
Issues and PRs related to containerd integration
kind/feature
Functionality or other elements that the project doesn't currently have. Features are new and shiny
Description
When looking at the API response for
GET /images/json
with containerd integration enabled, I noticed thatSize
andVirtualSize
were not the same;However, they are expected to be the same or at least, that's what the API documents it as;
The new containerd integration shows different sizes for
Size
andVirtualSize
;moby/daemon/containerd/image_list.go
Lines 64 to 67 in 98d8343
moby/daemon/containerd/service.go
Lines 185 to 198 in 5bf405b
moby/daemon/containerd/image_list.go
Lines 479 to 489 in 5bf405b
Whereas the old implementation considered them equal;
moby/daemon/images/image_list.go
Lines 251 to 252 in 98d8343
VirtualSize
was a concept from "before" Docker 1.10, where images were not self-contained, and had "parent" images; in this situationSize
was the size of the image, and VirtualSize the size of the image including the layer-size of all its parents.However, starting with Docker 1.10, images are self-contained, which means that an image contains a list of all of its layers, so
Size
became an equivalent forVirtualSize
.investigate using containerd's
WithSnapshotUsage()
We currently get image Size using
image.Size()
, which includes the size of the Manifest (and compressed layers???);https://github.com/containerd/containerd/blob/8c27ce41930c52d2a536ff1c31d80ffdc01845e6/image.go#L162-L164
We should look into containerd's
WithSnapshotUsage
, which looks to include the size of the snapshots as well (which looks to be a close(r) match to what we want to present?https://github.com/containerd/containerd/blob/8c27ce41930c52d2a536ff1c31d80ffdc01845e6/image.go#L94-L101
The text was updated successfully, but these errors were encountered: