Skip to content

Commit

Permalink
ignore path not found error when look up tags
Browse files Browse the repository at this point in the history
Signed-off-by: Wenkai Yin <yinw@vmware.com>
  • Loading branch information
ywk253100 committed Feb 8, 2018
1 parent 1ba5b3b commit 005c6e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions registry/storage/tagstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ func (ts *tagStore) Lookup(ctx context.Context, desc distribution.Descriptor) ([
tagLinkPath, err := pathFor(tagLinkPathSpec)
tagDigest, err := ts.blobStore.readlink(ctx, tagLinkPath)
if err != nil {
switch err.(type) {
case storagedriver.PathNotFoundError:
continue
}
return nil, err
}

Expand Down
4 changes: 2 additions & 2 deletions registry/storage/tagstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ func TestTagStoreUnTag(t *testing.T) {
desc := distribution.Descriptor{Digest: "sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"}

err := tags.Untag(ctx, "latest")
if err == nil {
t.Errorf("Expected error untagging non-existant tag")
if err != nil {
t.Error(err)
}

err = tags.Tag(ctx, "latest", desc)
Expand Down

0 comments on commit 005c6e0

Please sign in to comment.