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

Commit

Permalink
Merge pull request #2782 from 2opremio/clarify-cached-errors
Browse files Browse the repository at this point in the history
Distinguish cached registry errors from live ones
  • Loading branch information
2opremio authored Jan 23, 2020
2 parents 1516b06 + ce21305 commit 5cec301
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 5cec301

Please sign in to comment.