Skip to content

Commit

Permalink
skip empty object key returned by some s3 compatible storage while li…
Browse files Browse the repository at this point in the history
…sting boltdb-shipper index (#6123)
  • Loading branch information
sandeepsukhani authored May 17, 2022
1 parent e5a89fa commit ead8c34
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/storage/stores/shipper/storage/cached_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ func (c *cachedObjectClient) buildCache(ctx context.Context, forceRefresh bool)
c.tableNames = []client.StorageCommonPrefix{}

for _, object := range objects {
// The s3 client can also return the directory itself in the ListObjects.
if object.Key == "" {
continue
}

ss := strings.Split(object.Key, delimiter)
if len(ss) < 2 || len(ss) > 3 {
return fmt.Errorf("invalid key: %s", object.Key)
Expand Down

0 comments on commit ead8c34

Please sign in to comment.