Skip to content

Commit

Permalink
Compactor: Fix for #844 - Ignore object if it is the current directory (
Browse files Browse the repository at this point in the history
#1544)

* Ignore object if it is the current directory

Signed-off-by: Jamie Poole <jimbobby5@yahoo.com>

* Add full-stop

Signed-off-by: Jamie Poole <jimbobby5@yahoo.com>
  • Loading branch information
jimbobby5 authored and brancz committed Sep 24, 2019
1 parent 5c59e44 commit 749b378
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/objstore/s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ func (b *Bucket) Iter(ctx context.Context, dir string, f func(string) error) err
if object.Key == "" {
continue
}
// The s3 client can also return the directory itself in the ListObjects call above.
if object.Key == dir {
continue
}
if err := f(object.Key); err != nil {
return err
}
Expand Down

0 comments on commit 749b378

Please sign in to comment.