Skip to content

Commit

Permalink
s3store: Accept alternate error response from DigitalOcean Spaces (#507)
Browse files Browse the repository at this point in the history
* fix digitalocean spaces fetch

* remove log

* remove log

* remove info.Size check

* Add comment

* Delete .gitignore

Co-authored-by: Marius <marius.kleidl@gmail.com>
  • Loading branch information
benitogf and Acconut authored Oct 15, 2021
1 parent dd44267 commit 16a3747
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/s3store/s3store.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 16a3747

Please sign in to comment.