From 1f0a2711bef9500a391f24f4f4dd091a002c6b0d Mon Sep 17 00:00:00 2001 From: Pallab Pain Date: Thu, 30 May 2024 13:45:19 +0530 Subject: [PATCH] fix(package): corrects exec command parsing (#312) --- riocli/package/model.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/riocli/package/model.py b/riocli/package/model.py index 93ab20b7..c802ed68 100644 --- a/riocli/package/model.py +++ b/riocli/package/model.py @@ -200,13 +200,18 @@ def _map_executable(self, exec): if 'livenessProbe' in exec: exec_object.livenessProbe = exec.livenessProbe - if exec.get('runAsBash'): - if 'command' in exec: - exec_object.cmd = ['/bin/bash', '-c', exec.command] - else: - # TODO verify this is right for secret? - if 'command' in exec: - exec_object.cmd = [exec.command] + if 'command' in exec: + c = [] + + if exec.get('runAsBash'): + c = ['/bin/bash', '-c'] + + if isinstance(exec.command, list): + c.extend(exec.command) + else: + c.append(exec.command) + + exec_object.cmd = c if exec.type == 'docker': exec_object.docker = exec.docker.image