Skip to content

Commit

Permalink
s3store: Fix downloads from some S3-compatible stores
Browse files Browse the repository at this point in the history
  • Loading branch information
Acconut committed Jan 24, 2024
1 parent 9f0aebe commit 64e6c07
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 @@ -694,7 +694,9 @@ func (upload s3Upload) fetchInfo(ctx context.Context) (info handler.FileInfo, pa
// The AWS Go SDK v2 has a bug where types.NoSuchUpload is not returned,
// so we also need to check the error code itself.
// See https://github.com/aws/aws-sdk-go-v2/issues/1635
if isAwsError[*types.NoSuchUpload](err) || isAwsErrorCode(err, "NoSuchUpload") || isAwsError[*types.NoSuchKey](err) {
// In addition, S3-compatible storages, like DigitalOcean Spaces, might cause
// types.NoSuchKey to not be returned as well.
if isAwsError[*types.NoSuchUpload](err) || isAwsErrorCode(err, "NoSuchUpload") || isAwsError[*types.NoSuchKey](err) || isAwsErrorCode(err, "NoSuchKey") {
info.Offset = info.Size
err = nil
}
Expand Down

0 comments on commit 64e6c07

Please sign in to comment.