adds log for each failed host and status not found on host
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
This commit is contained in:
parent
7e3fd8da24
commit
d21fe46250
@ -286,12 +286,14 @@ func (r *dockerResolver) Resolve(ctx context.Context, ref string) (string, ocisp
|
|||||||
if lastErr == nil {
|
if lastErr == nil {
|
||||||
lastErr = err
|
lastErr = err
|
||||||
}
|
}
|
||||||
|
log.G(ctx).WithError(err).Info("trying next host")
|
||||||
continue // try another host
|
continue // try another host
|
||||||
}
|
}
|
||||||
resp.Body.Close() // don't care about body contents.
|
resp.Body.Close() // don't care about body contents.
|
||||||
|
|
||||||
if resp.StatusCode > 299 {
|
if resp.StatusCode > 299 {
|
||||||
if resp.StatusCode == http.StatusNotFound {
|
if resp.StatusCode == http.StatusNotFound {
|
||||||
|
log.G(ctx).Info("trying next host - response was http.StatusNotFound")
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
return "", ocispec.Descriptor{}, errors.Errorf("unexpected status code %v: %v", u, resp.Status)
|
return "", ocispec.Descriptor{}, errors.Errorf("unexpected status code %v: %v", u, resp.Status)
|
||||||
|
Loading…
Reference in New Issue
Block a user