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 <jimbobby5@yahoo.com>

* Add full-stop

Signed-off-by: Jamie Poole <jimbobby5@yahoo.com>
Signed-off-by: Ivan Kiselev <kiselev_ivan@pm.me>
  • 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
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.