supply credentials file to PubSub

commit-id:563f6718
This commit is contained in:
justinschuldt 2022-02-01 02:56:36 -06:00 committed by Leopold Schabel
parent 60d313b23c
commit 763c62b73e
1 changed files with 3 additions and 1 deletions

View File

@ -55,7 +55,9 @@ func BigTableWriter(events *AttestationEventReporter, connectionConfig *BigTable
} }
tbl := client.Open(e.connectionConfig.TableName) tbl := client.Open(e.connectionConfig.TableName)
pubsubClient, err := pubsub.NewClient(ctx, e.connectionConfig.GcpProjectID) pubsubClient, err := pubsub.NewClient(ctx,
e.connectionConfig.GcpProjectID,
option.WithCredentialsFile(e.connectionConfig.GcpKeyFilePath))
if err != nil { if err != nil {
logger.Error("failed to create GCP PubSub client", zap.Error(err)) logger.Error("failed to create GCP PubSub client", zap.Error(err))
return fmt.Errorf("failed to create GCP PubSub client: %w", err) return fmt.Errorf("failed to create GCP PubSub client: %w", err)