From 5f87e9099e36f097153266bbacadd846130724e6 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Fri, 12 Jun 2026 15:42:50 +0200 Subject: [PATCH] =?UTF-8?q?agent:=20golden=20P2B=20=E2=80=94=20controller?= =?UTF-8?q?=20container=20gets=20/mnt:rslave=20+=20/mnt=20made=20rshared?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit build-golden.sh bootstrap makes /mnt a shared mount and binds it :rslave into the controller container so enrolled data drives (and P3 self-heal remounts) propagate in. Scoped to /mnt (Model A: only felhom-data-namespace mounts). Spike-proven. Co-Authored-By: Claude Opus 4.8 (1M context) --- configs/build-golden.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/configs/build-golden.sh b/configs/build-golden.sh index 3313733..94d1be1 100644 --- a/configs/build-golden.sh +++ b/configs/build-golden.sh @@ -126,16 +126,24 @@ docker rm -f felhom-controller >/dev/null 2>&1 || true # creates empty dirs → every bind-mounted stack (base infra AND customer apps) breaks. A named volume # would NOT fix this (it resolves to /var/lib/docker/volumes/...). Pre-create the dir, then same-path bind. mkdir -p /opt/docker/stacks -# slice 8C: the controller is DE-PRIVILEGED — disk execution (scan/format/mount/migrate) is the -# host agent's job now, so this run grants NO disk privileges: no --privileged, no /dev, no -# /etc/fstab, no rshared /mnt. Only the bootstrap config (ro), the data volume, the stacks dir -# (same-path host bind), and the docker socket (app/stack management). The controller reaches the -# agent's local API for disk management. +# slice 10 P2: the controller must SEE enrolled external data drives, which the agent binds into the +# guest at /mnt/. Make /mnt a SHARED mount so those binds (and later host-remount self-heal) +# propagate into the controller container, then bind /mnt :rslave (host->container propagation ONLY — +# the container can't mutate the guest mount tree). This is the ONE bind the 8C de-privileging left +# out; scoped to /mnt, which (Model A) holds only Felhom's felhom-data-namespace mounts, never the +# customer's other on-drive data. rbind preserves existing submounts; re-running re-shares (safe). +mkdir -p /mnt +mountpoint -q /mnt || mount --rbind /mnt /mnt +mount --make-rshared /mnt +# Otherwise still DE-PRIVILEGED: disk EXECUTION (scan/format/mount) stays the agent's — NO --privileged, +# no /dev, no /etc/fstab. Bootstrap config (ro), data volume, stacks dir (same-path), the /mnt :rslave +# view, and the docker socket. The controller reaches the agent's local API for disk management. docker run -d --name felhom-controller --restart unless-stopped "${HOSTNAME_ARGS[@]}" \ -e FELHOM_BOOTSTRAP_PATH=/etc/felhom-bootstrap/bootstrap.json \ -v /etc/felhom-bootstrap:/etc/felhom-bootstrap:ro \ -v felhom-controller-data:/opt/docker/felhom-controller \ -v /opt/docker/stacks:/opt/docker/stacks \ + -v /mnt:/mnt:rslave \ -v /var/run/docker.sock:/var/run/docker.sock \ "$IMAGE" echo "[ctrl-bootstrap] controller started"