kpod rmi by ID untagged: %name incorrect

As described in https://github.com/kubernetes-incubator/cri-o/issues/888, when
deleting by ID, the name being returned for the untagged message was "".

Signed-off-by: baude <bbaude@redhat.com>
This commit is contained in:
baude 2017-09-12 13:30:36 -05:00
parent 3e2ad8f10a
commit e27230bbaf

View file

@ -11,7 +11,7 @@ func UntagImage(store storage.Store, image *storage.Image, imgArg string) (strin
newNames := []string{} newNames := []string{}
removedName := "" removedName := ""
for _, name := range image.Names { for _, name := range image.Names {
if MatchesReference(name, imgArg) { if MatchesReference(name, imgArg) || MatchesID(imgArg, image.ID) {
removedName = name removedName = name
continue continue
} }