fix: support "container.network: host" when using job services #1318

Merged
mfenniak merged 1 commit from mfenniak/forgejo-runner:fix-networkmodehost-services into main 2026-01-22 21:58:25 +00:00
Owner

Code archaeology here suggests that when services were first added to act, the intent was to force a randomly named isolated network when services were present. Despite that intent, in runner v8.1.0 it was permitted to allow host networking to work when services were present. This regressed in 8a8e01522d and currently neither behaviour works: a random network name is generated but not the network won't be created, causing an error in this configuration.

This PR fixes the regression and adds a test verifying host networking and services can be used together. This configuration is in-use in the wild. Fixes #1310.

  • bug fixes
    • PR: fix: support "container.network: host" when using job services
Code archaeology here suggests that when services were first added to `act`, the intent was to force a randomly named isolated network when services were present. Despite that intent, in runner v8.1.0 it was permitted to allow host networking to work when services were present. This regressed in 8a8e01522d249399992a29cd4ecb9594cd69d416 and currently neither behaviour works: a random network name is generated but not the network won't be created, causing an error in this configuration. This PR fixes the regression and adds a test verifying host networking and services can be used together. This configuration is in-use in the wild. Fixes #1310. <!--start release-notes-assistant--> <!--URL:https://code.forgejo.org/forgejo/runner--> - bug fixes - [PR](https://code.forgejo.org/forgejo/runner/pulls/1318): <!--number 1318 --><!--line 0 --><!--description Zml4OiBzdXBwb3J0ICJjb250YWluZXIubmV0d29yazogaG9zdCIgd2hlbiB1c2luZyBqb2Igc2VydmljZXM=-->fix: support "container.network: host" when using job services<!--description--> <!--end release-notes-assistant-->
fix: support ContainerNetworkMode: host when using job services
All checks were successful
checks / validate pre-commit-hooks file (pull_request) Successful in 42s
checks / validate mocks (pull_request) Successful in 46s
checks / Build Forgejo Runner (pull_request) Successful in 49s
checks / runner exec tests (pull_request) Successful in 38s
checks / Build unsupported platforms (pull_request) Successful in 1m2s
issue-labels / release-notes (pull_request_target) Successful in 6s
checks / integration tests (docker-latest) (pull_request) Successful in 10m16s
checks / integration tests (docker-stable) (pull_request) Successful in 13m22s
cascade / debug (pull_request_target) Has been skipped
cascade / end-to-end (pull_request_target) Successful in 6s
cascade / forgejo (pull_request_target) Successful in 1m18s
96e0416e96
viceice approved these changes 2026-01-22 21:39:40 +00:00
mfenniak deleted branch fix-networkmodehost-services 2026-01-22 21:58:27 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo/runner!1318
No description provided.