pool join: preserve existing daemon ExecStart flags (don't reset to minimal)
Problem
pool join writes a systemd drop-in (renderPoolDropIn) that clears and
re-sets the daemon ExecStart to a minimal command:
ExecStart=
ExecStart=/usr/local/bin/containarium daemon --rest --jwt-secret-file <f> --pool <p> (+ optional --base-domain)
On a host whose daemon already runs with additional flags, those flags are silently dropped on the next daemon restart. Observed on a host being onboarded that ran:
daemon --app-hosting --rest --jwt-secret-file <f> --network-subnet <cidr>
After pool join, both --app-hosting and --network-subnet <cidr> would be
gone. That's the worst possible time to change behavior:
--network-subnet <cidr>is the bridge the host's pre-existing containers already live on — dropping it makes the daemon fall back to a default subnet and can break those containers' networking.--app-hostingdisables local routing/Caddy management.
This is exactly the bring-your-own-compute case (prd/oss/byo-compute-pool-join.md):
you join a host that is already running workloads with a customized daemon
config, and pool join resets it.
Repro
- Run the daemon with any non-minimal
ExecStart(extra flags). containarium pool join --dry-run …→ the renderedpool.confresetsExecStartto the minimal form (the extra flags are absent).- A real join restarts the daemon without them.
--dry-run does surface it (good) — but an operator who skips dry-run is bitten
silently.
Fix options
- Preserve by default (preferred): read the current effective
ExecStart(e.g.systemctl show -p ExecStart) and carry its flags into the drop-in, appending only--pool(+--base-domain). - Escape hatch: accept a repeatable
--daemon-flag/--extra-daemon-argsonpool jointo pass arbitrary flags through into the drop-in. - At minimum, fail-loud: if
pool joindetects an existing non-minimalExecStartit would clobber, refuse (or warn hard) and list the flags that would be dropped, instead of silently resetting.
Preferred = (1) + (3), with (2) as the explicit override.
Refs: internal/cmd/pool_join.go (renderPoolDropIn), prd/oss/byo-compute-pool-join.md.