From e75cec5e007336a928267bc56c4c41c6594c1bb3 Mon Sep 17 00:00:00 2001 From: Al Cutter Date: Tue, 20 Aug 2024 16:18:03 +0100 Subject: [PATCH] Don't scan buckets (#154) --- storage/gcp/gcp.go | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/storage/gcp/gcp.go b/storage/gcp/gcp.go index 46b95dbd..8b21bfd4 100644 --- a/storage/gcp/gcp.go +++ b/storage/gcp/gcp.go @@ -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,