Skip to content

Commit

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

* Ignore object if it is the current directory

Signed-off-by: Jamie Poole <[email protected]>

* Add full-stop

Signed-off-by: Jamie Poole <[email protected]>
Signed-off-by: Ivan Kiselev <[email protected]>
  • Loading branch information
jimbobby5 authored and Ivan Kiselev committed Sep 26, 2019
1 parent 546038b commit 37ac272
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 37ac272

Please sign in to comment.