Skip to content

Commit

Permalink
Hacky way of testing error
Browse files Browse the repository at this point in the history
  • Loading branch information
paul1r committed Sep 5, 2024
1 parent 00e47f8 commit 5371da6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/storage/chunk/client/aws/s3_storage_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,12 @@ func (a *S3ObjectClient) ObjectExists(ctx context.Context, objectKey string) (bo
if lastErr == nil {
return true, nil
}
// AWS SDK v1 doesn't properly support error unwrapping, so we have to check the error message
// https://github.com/aws/aws-sdk-go/issues/2820#issuecomment-822767966
if strings.Contains(lastErr.Error(), "NoSuchKey") {
return false, lastErr
}

retries.Wait()
}

Expand Down

0 comments on commit 5371da6

Please sign in to comment.