Skip to content

Commit

Permalink
Don't scan buckets (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCutter authored Aug 20, 2024
1 parent e7a8d34 commit e75cec5
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions storage/gcp/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -621,19 +621,6 @@ type gcsStorage struct {
//
// The specified bucket must exist or an error will be returned.
func newGCSStorage(ctx context.Context, c *gcs.Client, projectID string, bucket string) (*gcsStorage, error) {
it := c.Buckets(ctx, projectID)
for {
bAttrs, err := it.Next()
if err == iterator.Done {
return nil, fmt.Errorf("bucket %q does not exist, please create it", bucket)
}
if err != nil {
return nil, fmt.Errorf("error scanning buckets: %v", err)
}
if bAttrs.Name == bucket {
break
}
}
r := &gcsStorage{
gcsClient: c,
bucket: bucket,
Expand Down

0 comments on commit e75cec5

Please sign in to comment.