Skip to content

Commit

Permalink
remotes/docker: log registry URLs as info instead of debug
Browse files Browse the repository at this point in the history
Registry URLs are important and should be logged even the logging level is
info.

Fixes containerd#5486.

Signed-off-by: Kazuyoshi Kato <[email protected]>
  • Loading branch information
kzys authored and Kirtana Ashok committed Jan 18, 2023
1 parent fb5f876 commit 8b77c35
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions remotes/docker/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
// firstly try fetch via external urls
for _, us := range desc.URLs {
ctx = log.WithLogger(ctx, log.G(ctx).WithField("url", us))

u, err := url.Parse(us)
if err != nil {
log.G(ctx).WithError(err).Debug("failed to parse")
log.G(ctx).WithError(err).Debugf("failed to parse %q", us)
continue
}
if u.Scheme != "http" && u.Scheme != "https" {
log.G(ctx).Debug("non-http(s) alternative url is unsupported")
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
host := RegistryHost{
Expand Down

0 comments on commit 8b77c35

Please sign in to comment.