diff options
author | Devan Carpenter <devan@taler.net> | 2024-02-16 23:56:48 -0500 |
---|---|---|
committer | Devan Carpenter <devan@taler.net> | 2024-02-16 23:56:48 -0500 |
commit | c4f85e623771ca9805f562df6d8b37623535069a (patch) | |
tree | d31c97227eab4c7c765a204ec90787dc0f5bf82e | |
parent | b2f649b1a94477322438d069526977c452a717e7 (diff) | |
download | deployment-c4f85e623771ca9805f562df6d8b37623535069a.tar.gz deployment-c4f85e623771ca9805f562df6d8b37623535069a.tar.bz2 deployment-c4f85e623771ca9805f562df6d8b37623535069a.zip |
bbot: specify the user of the UID we want
If we just pull the UID value from the environment, then we get the
buildbot master user's UID, and we want to the container-worker's UID,
so we must specify this by name.
This still retains some benefits over hardcoding the UID, because at
least it can persist through system re-installations.
-rw-r--r-- | buildbot/master.cfg | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/buildbot/master.cfg b/buildbot/master.cfg index 559bf06..c8681de 100644 --- a/buildbot/master.cfg +++ b/buildbot/master.cfg @@ -29,6 +29,7 @@ import configparser import glob import os import pathlib +import pwd import re import subprocess @@ -230,7 +231,7 @@ def container_add_step(HALT_ON_FAILURE, "--env", util.Interpolate("CI_GIT_BRANCH=%(src::branch)s"), "--volume", f"{WORK_DIR}:/workdir", "--volume", "/home/container-worker/container_artifacts:/artifacts", - "--volume", f"/run/user/{os.getuid()}/podman/podman.sock:/run/podman/podman.sock", + "--volume", f"/run/user/{pwd.getpwnam('container-worker').pw_uid}/podman/podman.sock:/run/podman/podman.sock", "--security-opt", "label=disable", "--workdir", "/workdir", CONTAINER_NAME, jobCmd], |