Skip to content

Commit

Permalink
fix(datastore): correct prefix to list with S3 storage (#376)
Browse files Browse the repository at this point in the history
  • Loading branch information
seboudry authored Oct 30, 2024
1 parent 11dfcd5 commit 96f8443
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/datastore/storage/s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ package s3
import (
"bytes"
"context"
"fmt"
"io"
"strings"

sdk "github.com/aws/aws-sdk-go-v2/config"
storage "github.com/aws/aws-sdk-go-v2/service/s3"
Expand Down Expand Up @@ -86,7 +88,7 @@ func (a *S3) Delete(key string) error {
func (a *S3) List(prefix string) ([]string, error) {
input := &storage.ListObjectsV2Input{
Bucket: &a.Config.Bucket,
Prefix: &prefix,
Prefix: aws.String(fmt.Sprintf("%s/", strings.TrimPrefix(prefix, "/"))),
Delimiter: aws.String("/"),
}
result, err := a.Client.ListObjectsV2(context.TODO(), input)
Expand Down

0 comments on commit 96f8443

Please sign in to comment.