Merge pull request #10 from digitalocean/awg/resume-commit-race

Return a sensible error in races between blob upload completions
This commit is contained in:
Adam Wolfe Gordon 2020-08-24 14:59:01 -06:00 committed by GitHub
commit 1e1c67e13f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -210,7 +210,17 @@ func (lbs *linkedBlobStore) Resume(ctx context.Context, id string) (distribution
return nil, err
}
return lbs.newBlobUpload(ctx, id, path, startedAt, true)
bw, err := lbs.newBlobUpload(ctx, id, path, startedAt, true)
if err != nil {
switch err := err.(type) {
case driver.PathNotFoundError:
return nil, distribution.ErrBlobUploadUnknown
default:
return nil, err
}
}
return bw, nil
}
func (lbs *linkedBlobStore) Delete(ctx context.Context, dgst digest.Digest) error {