conf: Handle app_key correctly for GitHub connections

app_key is expected to be a file path, not a value in the
configuration file.

Change-Id: Ibf0641cd31148749477003ced574410178cace7c
This commit is contained in:
Michael Kelly 2023-05-11 15:07:57 -07:00
parent c1febff1ea
commit 9590d5a55b
No known key found for this signature in database
GPG Key ID: 77F7FE93040ECF3E

View File

@ -215,8 +215,8 @@ class Zuul:
filter(namespace=self.namespace).\ filter(namespace=self.namespace).\
get(name=connection['secretName']) get(name=connection['secretName'])
for k, v in obj.obj['data'].items(): for k, v in obj.obj['data'].items():
if k == 'sshkey': if k in ('sshkey', 'app_key'):
v = f'/etc/zuul/connections/{connection_name}/sshkey' v = f'/etc/zuul/connections/{connection_name}/{k}'
else: else:
v = base64.b64decode(v).decode('utf-8') v = base64.b64decode(v).decode('utf-8')
connection[k] = v connection[k] = v