Avoid returning nil, nil when fetching a manifest by tag by introducing a new

error ErrManifestNotModified which can be checked by clients.

Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
This commit is contained in:
Richard Scothern 2015-09-18 11:00:44 -07:00
parent 5a8fabfee3
commit b8a1ec4155
3 changed files with 5 additions and 8 deletions

View file

@ -288,7 +288,7 @@ func (ms *manifests) GetByTag(tag string, options ...distribution.ManifestServic
}
defer resp.Body.Close()
if resp.StatusCode == http.StatusNotModified {
return nil, nil
return nil, distribution.ErrManifestNotModified
} else if SuccessStatus(resp.StatusCode) {
var sm schema1.SignedManifest
decoder := json.NewDecoder(resp.Body)