Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Distinguish cached registry errors from live ones
Browse files Browse the repository at this point in the history
Without the extra context, the error seems to come from just have accessed the
registry, which makes debugging hard.

See #2780 (comment)
  • Loading branch information
Alfonso Acosta committed Jan 23, 2020
1 parent 1516b06 commit ce21305
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/registry/cache/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cache

import (
"encoding/json"
"fmt"
"time"

"github.com/pkg/errors"
Expand Down Expand Up @@ -90,7 +91,7 @@ func (c *Cache) GetImageRepositoryMetadata(id image.Name) (image.RepositoryMetad
// updated the result.
if repo.LastUpdate.IsZero() {
if repo.LastError != "" {
return image.RepositoryMetadata{}, errors.New(repo.LastError)
return image.RepositoryMetadata{}, fmt.Errorf("item not in cache, last error: %s", repo.LastError)
}
return image.RepositoryMetadata{}, ErrNotCached
}
Expand Down

0 comments on commit ce21305

Please sign in to comment.