c8d/prune: Familiarize image names that were untagged
To align with the graphdriver implementation. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
parent
8ba8a59697
commit
bea729c030
2 changed files with 12 additions and 1 deletions
|
@ -341,3 +341,14 @@ func (i *ImageService) getAllImagesWithRepository(ctx context.Context, ref refer
|
|||
nameFilter := "^" + regexp.QuoteMeta(ref.Name()) + ":" + reference.TagRegexp.String() + "$"
|
||||
return i.client.ImageService().List(ctx, "name~="+strconv.Quote(nameFilter))
|
||||
}
|
||||
|
||||
func imageFamiliarName(img containerdimages.Image) string {
|
||||
if isDanglingImage(img) {
|
||||
return img.Target.Digest.String()
|
||||
}
|
||||
|
||||
if ref, err := reference.ParseNamed(img.Name); err == nil {
|
||||
return reference.FamiliarString(ref)
|
||||
}
|
||||
return img.Name
|
||||
}
|
||||
|
|
|
@ -184,7 +184,7 @@ func (i *ImageService) pruneUnused(ctx context.Context, filterFunc imageFilterFu
|
|||
|
||||
report.ImagesDeleted = append(report.ImagesDeleted,
|
||||
image.DeleteResponse{
|
||||
Untagged: img.Name,
|
||||
Untagged: imageFamiliarName(img),
|
||||
},
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue