-
Notifications
You must be signed in to change notification settings - Fork 145
Fix issue #60: keyFile in config (#60) #61
base: master
Are you sure you want to change the base?
Conversation
Fix logic if keyFile is null
return new StorageClient([ | ||
'projectId' => $config['project_id'], | ||
'keyFilePath' => $keyFile, | ||
'keyFile' => array_merge(["project_id" => $config['project_id']], $keyFile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can actually skip this whole is_array
check entirely and just remove the array_merge
. The key file should already contain project_id
, so I'm not sure why it needs to be merged in the first place?
@nicja thoughts on trying to get some tests in here? I'm wondering if @ralfiannor should perhaps at least add a test for the config merging, but that would require some setup on your side to get a pipeline running. |
Confirmed that this fix works for a GKE-powered environment with creds provided at the instance level. Had the same issue mentioned in #68. I'll fork off of this branch and a test that fails prior to this commit and succeeds with the commit if that's what it takes to get this merged. |
Fix logic if keyFile is null