From c4f85e623771ca9805f562df6d8b37623535069a Mon Sep 17 00:00:00 2001 From: Devan Carpenter Date: Fri, 16 Feb 2024 23:56:48 -0500 Subject: 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. --- buildbot/master.cfg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'buildbot/master.cfg') 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], -- cgit v1.2.3