File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -251,7 +251,8 @@ def _index(l: List, s: str) -> Optional[int]:
251251 pass
252252
253253
254- def load_task (task_id , remove = True ):
254+ def load_task (task_id , remove = True , user = None ):
255+ user = user or "worker"
255256 task_def = get_task_definition (task_id )
256257
257258 if (
@@ -316,7 +317,7 @@ def load_task(task_id, remove=True):
316317 image_tag ,
317318 "bash" ,
318319 "-c" ,
319- f"{ shlex .join (command )} && cd $TASK_WORKDIR && su -p worker " ,
320+ f"{ shlex .join (command )} && cd $TASK_WORKDIR && su -p { user } " ,
320321 ]
321322
322323 if remove :
Original file line number Diff line number Diff line change @@ -667,11 +667,12 @@ def image_digest(args):
667667 default = True ,
668668 help = "Keep the docker container after exiting." ,
669669)
670+ @argument ("--user" , default = None , help = "Container user to start shell with." )
670671def load_task (args ):
671672 from taskgraph .docker import load_task
672673
673674 validate_docker ()
674- return load_task (args ["task_id" ], remove = args ["remove" ])
675+ return load_task (args ["task_id" ], remove = args ["remove" ], user = args [ "user" ] )
675676
676677
677678@command ("decision" , help = "Run the decision task" )
You can’t perform that action at this time.
0 commit comments