浏览代码

supply credentials file to PubSub

commit-id:563f6718
justinschuldt 3 年之前
父节点
当前提交
763c62b73e
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      node/pkg/reporter/bigtablewriter.go

+ 3 - 1
node/pkg/reporter/bigtablewriter.go

@@ -55,7 +55,9 @@ func BigTableWriter(events *AttestationEventReporter, connectionConfig *BigTable
 		}
 		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 {
 			logger.Error("failed to create GCP PubSub client", zap.Error(err))
 			return fmt.Errorf("failed to create GCP PubSub client: %w", err)