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:
parent
8dd755fbf5
commit
5d7b31da73
|
@ -367,6 +367,12 @@ func (i *LibpodAPI) SearchImage(call iopodman.VarlinkCall, name string, limit in
|
||||||
for _, reg := range registries {
|
for _, reg := range registries {
|
||||||
results, err := docker.SearchRegistry(getContext(), sc, reg, name, int(limit))
|
results, err := docker.SearchRegistry(getContext(), sc, reg, name, int(limit))
|
||||||
if err != nil {
|
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())
|
return call.ReplyErrorOccurred(err.Error())
|
||||||
}
|
}
|
||||||
for _, result := range results {
|
for _, result := range results {
|
||||||
|
|
Loading…
Reference in New Issue