Skip to content

Commit

Permalink
list instead of attrs
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Elliott <number101010@gmail.com>
  • Loading branch information
joe-elliott committed Feb 24, 2021
1 parent 7182326 commit 73a260c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tempodb/backend/gcs/gcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,14 @@ func New(cfg *Config) (backend.Reader, backend.Writer, backend.Compactor, error)

bucket := client.Bucket(cfg.BucketName)

// Check bucket exists by getting attrs
if _, err = bucket.Attrs(ctx); err != nil {
return nil, nil, nil, errors.Wrap(err, "getting bucket attrs")
// Check bucket exists by listing things
iter := bucket.Objects(ctx, &storage.Query{
Prefix: "/",
Versions: false,
})
_, err = iter.Next()
if err != nil && err != iterator.Done {
return nil, nil, nil, errors.Wrap(err, "listing bucket objects")
}

rw := &readerWriter{
Expand Down

0 comments on commit 73a260c

Please sign in to comment.