Skip to content

Don't validate that the issuer bucket exists, and fail if it does not. #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions storage/gcp/issuers.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ import (
"path"

gcs "cloud.google.com/go/storage"
"github.com/transparency-dev/static-ct"
sctfe "github.com/transparency-dev/static-ct"
"google.golang.org/api/googleapi"
"google.golang.org/api/iterator"
"k8s.io/klog/v2"
)

Expand All @@ -43,19 +42,6 @@ func NewIssuerStorage(ctx context.Context, projectID string, bucket string, pref
return nil, fmt.Errorf("failed to create GCS client: %v", err)
}

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 := &IssuersStorage{
bucket: c.Bucket(bucket),
prefix: prefix,
Expand Down
Loading