Merge pull request #6524 from thaJeztah/rm_deprecated_virtualsize

remove VirtualSize formatting options and output
This commit is contained in:
Sebastiaan van Stijn
2025-10-01 12:09:25 +02:00
committed by GitHub
5 changed files with 64 additions and 112 deletions

View File

@ -202,7 +202,6 @@ func newImageContext() *imageContext {
"CreatedAt": CreatedAtHeader,
"Size": SizeHeader,
"Containers": containersHeader,
"VirtualSize": SizeHeader, // Deprecated: VirtualSize is deprecated, and equivalent to Size.
"SharedSize": sharedSizeHeader,
"UniqueSize": uniqueSizeHeader,
}
@ -257,15 +256,6 @@ func (c *imageContext) Containers() string {
return strconv.FormatInt(c.i.Containers, 10)
}
// VirtualSize shows the virtual size of the image and all of its parent
// images. Starting with docker 1.10, images are self-contained, and
// the VirtualSize is identical to Size.
//
// Deprecated: VirtualSize is deprecated, and equivalent to [imageContext.Size].
func (c *imageContext) VirtualSize() string {
return units.HumanSize(float64(c.i.Size))
}
func (c *imageContext) SharedSize() string {
if c.i.SharedSize == -1 {
return "N/A"

View File

@ -68,11 +68,6 @@ func TestImageContext(t *testing.T) {
expValue: "10",
call: ctx.Containers,
},
{
imageCtx: imageContext{i: image.Summary{Size: 10000}},
expValue: "10kB",
call: ctx.VirtualSize, //nolint:nolintlint,staticcheck // ignore SA1019: field is deprecated, but still set on API < v1.44.
},
{
imageCtx: imageContext{i: image.Summary{SharedSize: 10000}},
expValue: "10kB",