Skip to content

Commit

Permalink
Change Iter options to be more standard
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaoBraveCoding committed Nov 14, 2023
1 parent 9878c97 commit f6ea86d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/storage/chunk/client/gcp/gcs_thanos_object_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ func (s *GCSThanosObjectClient) GetObject(ctx context.Context, objectKey string)
func (s *GCSThanosObjectClient) List(ctx context.Context, prefix, delimiter string) ([]client.StorageObject, []client.StorageCommonPrefix, error) {
var storageObjects []client.StorageObject
var commonPrefixes []client.StorageCommonPrefix
iterParams := objstore.IterOption(func(params *objstore.IterParams) {})
var iterParams []objstore.IterOption

// If delimiter is empty we want to list all files
if delimiter == "" {
iterParams = objstore.WithRecursiveIter
iterParams = append(iterParams, objstore.WithRecursiveIter)
}

s.client.Iter(ctx, prefix, func(objectKey string) error {
Expand All @@ -94,7 +94,7 @@ func (s *GCSThanosObjectClient) List(ctx context.Context, prefix, delimiter stri

return nil

}, iterParams)
}, iterParams...)

return storageObjects, commonPrefixes, nil
}
Expand Down

0 comments on commit f6ea86d

Please sign in to comment.