c8d/list: Handle unpacked layers when calculating shared size
After a535a65c4b
the size reported by the
image list was changed to include all platforms of that image.
This made the "shared size" calculation consider all diff ids of all the
platforms available in the image which caused "snapshot not found"
errors when multiple images were sharing the same layer which wasn't
unpacked.
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
parent
4531a371f2
commit
0c2d83b5fb
1 changed files with 5 additions and 0 deletions
|
@ -650,6 +650,11 @@ func computeSharedSize(chainIDs []digest.Digest, layers map[digest.Digest]int, s
|
|||
}
|
||||
size, err := sizeFn(chainID)
|
||||
if err != nil {
|
||||
// Several images might share the same layer and neither of them
|
||||
// might be unpacked (for example if it's a non-host platform).
|
||||
if cerrdefs.IsNotFound(err) {
|
||||
continue
|
||||
}
|
||||
return 0, err
|
||||
}
|
||||
sharedSize += size
|
||||
|
|
Loading…
Reference in a new issue