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
  • Loading branch information
sandeepsukhani committed May 9, 2022
1 parent 31ca108 commit 26dff69
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 26dff69

Please sign in to comment.