Skip to content

Commit 9daedf7

Browse files
committed
fix(load-task): ensure final bash is invoked as 'worker' user
1 parent d5fc105 commit 9daedf7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/taskgraph/docker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def load_task(task_id, remove=True):
316316
image_tag,
317317
"bash",
318318
"-c",
319-
f"{shlex.join(command)} && cd $TASK_WORKDIR && bash",
319+
f"{shlex.join(command)} && cd $TASK_WORKDIR && su -p worker",
320320
]
321321

322322
if remove:

test/test_docker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def test_load_task(run_load_task):
158158
"-c",
159159
"/usr/bin/run-task --repo-checkout=/builds/worker/vcs/repo "
160160
"--task-cwd=/builds/worker/vcs/repo -- echo 'Task setup complete!\n"
161-
"Run `exec-task` to execute the task'\"'\"'s command.' && cd $TASK_WORKDIR && bash",
161+
"Run `exec-task` to execute the task'\"'\"'s command.' && cd $TASK_WORKDIR && su -p worker",
162162
]
163163

164164
mocks["subprocess_run"].assert_called_once()

0 commit comments

Comments
 (0)