From 16a3747ec421c041587f995ef4a00dc3e4ca004d Mon Sep 17 00:00:00 2001 From: benito Date: Sat, 16 Oct 2021 03:50:17 +0800 Subject: [PATCH] s3store: Accept alternate error response from DigitalOcean Spaces (#507) * fix digitalocean spaces fetch * remove log * remove log * remove info.Size check * Add comment * Delete .gitignore Co-authored-by: Marius --- pkg/s3store/s3store.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/s3store/s3store.go b/pkg/s3store/s3store.go index c5431c0..5e864b9 100644 --- a/pkg/s3store/s3store.go +++ b/pkg/s3store/s3store.go @@ -498,7 +498,9 @@ func (upload s3Upload) fetchInfo(ctx context.Context) (info handler.FileInfo, er // when the multipart upload has already been completed or aborted. Since // we already found the info object, we know that the upload has been // completed and therefore can ensure the the offset is the size. - if isAwsError(err, "NoSuchUpload") { + // AWS S3 returns NoSuchUpload, but other implementations, such as DigitalOcean + // Spaces, can also return NoSuchKey. + if isAwsError(err, "NoSuchUpload") || isAwsError(err, "NoSuchKey") { info.Offset = info.Size return info, nil } else {