Skip to content

Commit

Permalink
Use parsed user property
Browse files Browse the repository at this point in the history
  • Loading branch information
un-def committed Feb 4, 2025
1 parent 2f9990b commit 2fa0a78
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/dstack/api/_public/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,9 @@ def attach(

# TODO: get login name from runner in case it's not specified in the run configuration
# (i.e. the default image user is used, and it is not root)
container_user = self._run.run_spec.configuration.user
if container_user is None:
if job.job_spec.user is not None and job.job_spec.user.username is not None:
container_user = job.job_spec.user.username
else:
container_user = "root"

self._ssh_attach = SSHAttach(
Expand Down

0 comments on commit 2fa0a78

Please sign in to comment.