Skip to content

Commit 2ae6b61

Browse files
author
lijianguo
committed
chore(helmbroker): decode secret value
1 parent 9612326 commit 2ae6b61

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

rootfs/helmbroker/tasks.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
def provision(instance_id: str, details: ProvisionDetails):
1717
with InstanceLock(instance_id):
1818
chart_path = get_chart_path(instance_id)
19+
bind_yaml = f'{chart_path}/templates/bind.yaml'
20+
if os.path.exists(bind_yaml):
21+
os.remove(bind_yaml)
1922
if os.path.exists(f'{chart_path}/requirements.lock'):
2023
args = [
2124
"dependency",

rootfs/helmbroker/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,11 @@ def get_secret_key_value(ns, secret_ref):
225225
args = [
226226
"get", "secret", secret_ref['name'], "-n", ns, '-o', f"jsonpath=\'{secret_ref['jsonpath']}\'", # noqa
227227
]
228-
return command("kubectl", *args)
228+
status, output = command("kubectl", *args)
229+
if status == 0:
230+
import base64
231+
output = base64.b64decode(output).decode()
232+
return status, output
229233

230234

231235
class InstanceLock(object):

0 commit comments

Comments
 (0)