Skip to content

Commit 1b90a53

Browse files
committed
remove deprecated VirtualSize formatting options and output
The `VirtualSize` field was deprecated in [moby@1261fe6], and omitted / removed in API v1.44 in [moby@913b0f5], and the corresponding formatting placeholder was deprecated in [cli@f02301a]. This patch removes the formatting function, which also removes it from the `docker image ls --format=json` output. [moby@1261fe6]: moby/moby@1261fe6 [moby@913b0f5]: moby/moby@913b0f5 [cli@f02301a]: f02301a Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent c361deb commit 1b90a53

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

cli/command/formatter/image.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ func newImageContext() *imageContext {
202202
"CreatedAt": CreatedAtHeader,
203203
"Size": SizeHeader,
204204
"Containers": containersHeader,
205-
"VirtualSize": SizeHeader, // Deprecated: VirtualSize is deprecated, and equivalent to Size.
206205
"SharedSize": sharedSizeHeader,
207206
"UniqueSize": uniqueSizeHeader,
208207
}
@@ -257,15 +256,6 @@ func (c *imageContext) Containers() string {
257256
return strconv.FormatInt(c.i.Containers, 10)
258257
}
259258

260-
// VirtualSize shows the virtual size of the image and all of its parent
261-
// images. Starting with docker 1.10, images are self-contained, and
262-
// the VirtualSize is identical to Size.
263-
//
264-
// Deprecated: VirtualSize is deprecated, and equivalent to [imageContext.Size].
265-
func (c *imageContext) VirtualSize() string {
266-
return units.HumanSize(float64(c.i.Size))
267-
}
268-
269259
func (c *imageContext) SharedSize() string {
270260
if c.i.SharedSize == -1 {
271261
return "N/A"

cli/command/formatter/image_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,6 @@ func TestImageContext(t *testing.T) {
6868
expValue: "10",
6969
call: ctx.Containers,
7070
},
71-
{
72-
imageCtx: imageContext{i: image.Summary{Size: 10000}},
73-
expValue: "10kB",
74-
call: ctx.VirtualSize, //nolint:nolintlint,staticcheck // ignore SA1019: field is deprecated, but still set on API < v1.44.
75-
},
7671
{
7772
imageCtx: imageContext{i: image.Summary{SharedSize: 10000}},
7873
expValue: "10kB",

0 commit comments

Comments
 (0)