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 ece8e132bf
commit 924913b4c3
4 changed files with 11 additions and 9 deletions

View file

@ -603,13 +603,10 @@ func TestManifestFetchWithEtag(t *testing.T) {
t.Fatal(err)
}
m2, err := ms.GetByTag("latest", AddEtagToTag("latest", d1.String()))
if err != nil {
_, err = ms.GetByTag("latest", AddEtagToTag("latest", d1.String()))
if err != distribution.ErrManifestNotModified {
t.Fatal(err)
}
if m2 != nil {
t.Fatal("Expected empty manifest for matching etag")
}
}
func TestManifestDelete(t *testing.T) {