mirror of
https://github.com/distribution/distribution.git
synced 2025-09-05 00:41:19 +00:00
ignore path not found error when look up tags
Signed-off-by: Wenkai Yin <yinw@vmware.com>
(cherry picked from commit 005c6e0236
)
This commit is contained in:
@@ -182,6 +182,10 @@ func (ts *tagStore) Lookup(ctx context.Context, desc distribution.Descriptor) ([
|
|||||||
tagLinkPath, err := pathFor(tagLinkPathSpec)
|
tagLinkPath, err := pathFor(tagLinkPathSpec)
|
||||||
tagDigest, err := ts.blobStore.readlink(ctx, tagLinkPath)
|
tagDigest, err := ts.blobStore.readlink(ctx, tagLinkPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
switch err.(type) {
|
||||||
|
case storagedriver.PathNotFoundError:
|
||||||
|
continue
|
||||||
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -84,8 +84,8 @@ func TestTagStoreUnTag(t *testing.T) {
|
|||||||
desc := distribution.Descriptor{Digest: "sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"}
|
desc := distribution.Descriptor{Digest: "sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"}
|
||||||
|
|
||||||
err := tags.Untag(ctx, "latest")
|
err := tags.Untag(ctx, "latest")
|
||||||
if err == nil {
|
if err != nil {
|
||||||
t.Errorf("Expected error untagging non-existant tag")
|
t.Error(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = tags.Tag(ctx, "latest", desc)
|
err = tags.Tag(ctx, "latest", desc)
|
||||||
|
Reference in New Issue
Block a user