remotes/docker: log registry URLs as info instead of debug

Registry URLs are important and should be logged even the logging level is
info.

Fixes #5486.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
This commit is contained in:
Kazuyoshi Kato 2021-12-03 10:40:25 -08:00
parent d742453086
commit 5d4dc57802

View File

@ -52,18 +52,17 @@ func (r dockerFetcher) Fetch(ctx context.Context, desc ocispec.Descriptor) (io.R
return newHTTPReadSeeker(desc.Size, func(offset int64) (io.ReadCloser, error) { return newHTTPReadSeeker(desc.Size, func(offset int64) (io.ReadCloser, error) {
// firstly try fetch via external urls // firstly try fetch via external urls
for _, us := range desc.URLs { for _, us := range desc.URLs {
ctx = log.WithLogger(ctx, log.G(ctx).WithField("url", us))
u, err := url.Parse(us) u, err := url.Parse(us)
if err != nil { if err != nil {
log.G(ctx).WithError(err).Debug("failed to parse") log.G(ctx).WithError(err).Debugf("failed to parse %q", us)
continue continue
} }
if u.Scheme != "http" && u.Scheme != "https" { if u.Scheme != "http" && u.Scheme != "https" {
log.G(ctx).Debug("non-http(s) alternative url is unsupported") log.G(ctx).Debug("non-http(s) alternative url is unsupported")
continue continue
} }
log.G(ctx).Debug("trying alternative url") ctx = log.WithLogger(ctx, log.G(ctx).WithField("url", u))
log.G(ctx).Info("request")
// Try this first, parse it // Try this first, parse it
host := RegistryHost{ host := RegistryHost{