Browse Source

c8d/list: Fix diffIDs being outputted instead of chainIDs

The `identity.ChainIDs` call was accidentally removed in
b37ced255103c2dfd36c42685bdd9390f74eb10f.

This broke the shared size calculation for images with more than one
layer that were sharing the same compressed layer.

This was could be reproduced with:
```
$ docker pull docker.io/docker/desktop-kubernetes-coredns:v1.11.1
$ docker pull docker.io/docker/desktop-kubernetes-etcd:3.5.10-0
$ docker system df
```

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Paweł Gronowski 1 year ago
parent
commit
ad8a5a5732
1 changed files with 3 additions and 1 deletions
  1. 3 1
      daemon/containerd/image_list.go

+ 3 - 1
daemon/containerd/image_list.go

@@ -255,11 +255,13 @@ func (i *ImageService) imageSummary(ctx context.Context, img images.Image, platf
 
 		target := img.Target()
 
-		chainIDs, err := img.RootFS(ctx)
+		diffIDs, err := img.RootFS(ctx)
 		if err != nil {
 			return err
 		}
 
+		chainIDs := identity.ChainIDs(diffIDs)
+
 		ts, _, err := i.singlePlatformSize(ctx, img)
 		if err != nil {
 			return err