Merge pull request #5351 from mikebrow/resolver-debug-improvement

adds some debug log for each failed host
This commit is contained in:
Phil Estes 2021-04-14 14:54:58 -04:00 committed by GitHub
commit ce5d42fa2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -286,12 +286,14 @@ func (r *dockerResolver) Resolve(ctx context.Context, ref string) (string, ocisp
if lastErr == nil {
lastErr = err
}
log.G(ctx).WithError(err).Info("trying next host")
continue // try another host
}
resp.Body.Close() // don't care about body contents.
if resp.StatusCode > 299 {
if resp.StatusCode == http.StatusNotFound {
log.G(ctx).Info("trying next host - response was http.StatusNotFound")
continue
}
return "", ocispec.Descriptor{}, errors.Errorf("unexpected status code %v: %v", u, resp.Status)