Skip to content

Commit

Permalink
Merge pull request #1289 from michelle192837/pubsub
Browse files Browse the repository at this point in the history
Specify auto-project detection for PubSub.
  • Loading branch information
google-oss-prow[bot] authored Sep 17, 2024
2 parents 1192f6a + 2aff760 commit 70f4277
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/summarizer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func gcsFixer(ctx context.Context, projectSub string, configPath gcs.Path, tabPr
return nil, errors.New("malformed project/subscription")
}
projID, subID := parts[0], parts[1]
pubsubClient, err := gpubsub.NewClient(ctx, "", option.WithCredentialsFile(credPath))
pubsubClient, err := gpubsub.NewClient(ctx, gpubsub.DetectProjectID, option.WithCredentialsFile(credPath))
if err != nil {
logrus.WithError(err).Fatal("Failed to create pubsub client")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/tabulator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ func gcsFixer(ctx context.Context, projectSub string, configPath gcs.Path, gridP
return nil, errors.New("malformed project/subscription")
}
projID, subID := parts[0], parts[1]
pubsubClient, err := gpubsub.NewClient(ctx, "", option.WithCredentialsFile(credPath))
pubsubClient, err := gpubsub.NewClient(ctx, gpubsub.DetectProjectID, option.WithCredentialsFile(credPath))
if err != nil {
logrus.WithError(err).Fatal("Failed to create pubsub client")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/updater/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func main() {

mets := updater.CreateMetrics(prometheus.NewFactory())

pubsubClient, err := gpubsub.NewClient(ctx, "", option.WithCredentialsFile(opt.creds))
pubsubClient, err := gpubsub.NewClient(ctx, gpubsub.DetectProjectID, option.WithCredentialsFile(opt.creds))
if err != nil {
logrus.WithError(err).Fatal("Failed to create pubsub client")
}
Expand Down

0 comments on commit 70f4277

Please sign in to comment.