when searching, survive errors for multiple registries

when searching multiple registries for images, if we get an error on one
of the searches, we should keep going and complete the search.  if there
is only one search registry however, we will return an error.

Resolves: #1255

Signed-off-by: baude <bbaude@redhat.com>

Closes: #1257
Approved by: mheon
This commit is contained in:
baude 2018-08-11 10:07:45 -05:00 committed by Atomic Bot
parent 8dd755fbf5
commit 5d7b31da73
1 changed files with 6 additions and 0 deletions

View File

@ -367,6 +367,12 @@ func (i *LibpodAPI) SearchImage(call iopodman.VarlinkCall, name string, limit in
for _, reg := range registries {
results, err := docker.SearchRegistry(getContext(), sc, reg, name, int(limit))
if err != nil {
// If we are searching multiple registries, don't make something like an
// auth error fatal. Unfortunately we cannot differentiate between auth
// errors and other possibles errors
if len(registries) > 1 {
continue
}
return call.ReplyErrorOccurred(err.Error())
}
for _, result := range results {