Don't panic if an image's ID can't be parsed

Return a "doesn't match" result if an image's ID can't be turned into a
valid reference for any reason.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #217
Approved by: rhatdan
This commit is contained in:
Nalin Dahyabhai
2017-07-10 16:30:06 -04:00
committed by Atomic Bot
parent 83fe25ca4e
commit 98c4e0d970

View File

@@ -297,7 +297,7 @@ func matchesDangling(name string, dangling string) bool {
func matchesLabel(image storage.Image, store storage.Store, label string) bool {
storeRef, err := is.Transport.ParseStoreReference(store, "@"+image.ID)
if err != nil {
return false
}
img, err := storeRef.NewImage(nil)
if err != nil {