Skip to content

fix(service)!: make DOCKER_HOST module-owned; require uid#32

Merged
jcardozo-eth merged 3 commits into
mainfrom
fix/empty-environment-docker-host
Jul 23, 2026
Merged

fix(service)!: make DOCKER_HOST module-owned; require uid#32
jcardozo-eth merged 3 commits into
mainfrom
fix/empty-environment-docker-host

Conversation

@jcardozo-eth

@jcardozo-eth jcardozo-eth commented Jul 23, 2026

Copy link
Copy Markdown
Member

Closes #26.

Changes

Makes DOCKER_HOST for the managed runner service module-owned: derived from runner_account.uid and always rendered into the drop-in, so the manager, the healthcheck, and socket_mount all use the one rootless socket and can no longer diverge. runner_service.environment is now a passthrough for additional Environment= lines only; a DOCKER_HOST line there fails the compile, and a runner whose jobs need a different daemon uses the per-runner host key. runner_service.manage now requires runner_account.uid.

This resolves the reported bug: an empty or emptied runner_service.environment (including one reduced to [] by the -- knockout prefix) can no longer leave the manager without DOCKER_HOST, because the derived line is always present.

Breaking: runner_account.uid is required whenever runner_service.manage is on, and DOCKER_HOST can no longer be set through runner_service.environment.

Verification

  • The full local check suite passes (just check: 120 tests, plus lint, validation, and doc generation).
  • Each of the three new safeguards was confirmed to be doing its job: always adding the derived DOCKER_HOST, requiring a uid when the service is managed, and rejecting a hand-set DOCKER_HOST. For each one, the matching test was checked to fail when that safeguard is removed, so the tests genuinely cover the behaviour rather than passing by accident.
  • Regression test for the original bug, using Hiera's layered config data: a host removes the last runner_service.environment line that its shared (fleet-wide) config had set, using the -- removal marker, which leaves the environment list empty. The test confirms the service still gets the correct DOCKER_HOST (derived from the uid) instead of none — the exact situation that used to break.

DOCKER_HOST for the managed runner service is now derived from
runner_account.uid and rendered alongside any runner_service.environment
vars. A DOCKER_HOST line in runner_service.environment is rejected at
compile time, and runner_service.manage now requires runner_account.uid.

The manager's connection, the healthcheck, and socket_mount all read the
one derived socket, so they can no longer diverge; an emptied environment
can no longer leave the manager without DOCKER_HOST.

BREAKING CHANGE: runner_account.uid is required whenever
runner_service.manage is on, and DOCKER_HOST can no longer be set via
runner_service.environment.
Update the runner_service narrative and the host-requirements DOCKER_HOST
note: the managed service derives DOCKER_HOST from runner_account.uid;
runner_service.environment adds other variables and a DOCKER_HOST line
there fails the compile; an external daemon is a per-runner host concern,
not a supported manager override.
Describe the runners `host` key as GitLab Runner's native
`[runners.docker]` host passthrough, independent of the module-owned
DOCKER_HOST, instead of framing it as support for an external daemon.
@jcardozo-eth
jcardozo-eth merged commit 83f0699 into main Jul 23, 2026
3 checks passed
@jcardozo-eth
jcardozo-eth deleted the fix/empty-environment-docker-host branch July 23, 2026 12:26
@jcardozo-eth jcardozo-eth added this to the 2.0.0 milestone Jul 24, 2026
@jcardozo-eth jcardozo-eth added breaking Breaking change: lands only in a major release bug Something isn't working labels Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Breaking change: lands only in a major release bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make the managed runner service's DOCKER_HOST module-owned

1 participant