Skip to content

Commit 449e811

Browse files
authored
Use ADC credentials on the gcs storage client (#5102)
1 parent 9e178d6 commit 449e811

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

packages/components/src/storageUtils.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,15 +1036,12 @@ export const getGcsClient = () => {
10361036
const projectId = process.env.GOOGLE_CLOUD_STORAGE_PROJ_ID
10371037
const bucketName = process.env.GOOGLE_CLOUD_STORAGE_BUCKET_NAME
10381038

1039-
if (!pathToGcsCredential) {
1040-
throw new Error('GOOGLE_CLOUD_STORAGE_CREDENTIAL env variable is required')
1041-
}
10421039
if (!bucketName) {
10431040
throw new Error('GOOGLE_CLOUD_STORAGE_BUCKET_NAME env variable is required')
10441041
}
10451042

10461043
const storageConfig = {
1047-
keyFilename: pathToGcsCredential,
1044+
...(pathToGcsCredential ? { keyFilename: pathToGcsCredential } : {}),
10481045
...(projectId ? { projectId } : {})
10491046
}
10501047

0 commit comments

Comments
 (0)