fix manifest revision search, closes #1535
Signed-off-by: 姜继忠 <jizhong.jiangjz@alibaba-inc.com>
This commit is contained in:
parent
71d808de07
commit
5f38f0b1fe
@ -384,7 +384,7 @@ var _ distribution.BlobDescriptorService = &linkedBlobStatter{}
|
||||
|
||||
func (lbs *linkedBlobStatter) Stat(ctx context.Context, dgst digest.Digest) (distribution.Descriptor, error) {
|
||||
var (
|
||||
resolveErr error
|
||||
found bool
|
||||
target digest.Digest
|
||||
)
|
||||
|
||||
@ -395,19 +395,20 @@ func (lbs *linkedBlobStatter) Stat(ctx context.Context, dgst digest.Digest) (dis
|
||||
target, err = lbs.resolveWithLinkFunc(ctx, dgst, linkPathFn)
|
||||
|
||||
if err == nil {
|
||||
found = true
|
||||
break // success!
|
||||
}
|
||||
|
||||
switch err := err.(type) {
|
||||
case driver.PathNotFoundError:
|
||||
resolveErr = distribution.ErrBlobUnknown // move to the next linkPathFn, saving the error
|
||||
// do nothing, just move to the next linkPathFn
|
||||
default:
|
||||
return distribution.Descriptor{}, err
|
||||
}
|
||||
}
|
||||
|
||||
if resolveErr != nil {
|
||||
return distribution.Descriptor{}, resolveErr
|
||||
if !found {
|
||||
return distribution.Descriptor{}, distribution.ErrBlobUnknown
|
||||
}
|
||||
|
||||
if target != dgst {
|
||||
|
Loading…
Reference in New Issue
Block a user