Merge pull request '[FORGEJO] a network of "" is not the same as "host"' (#35) from earl-warren/act:wip-network into main

Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/35
Reviewed-by: twenty-panda <twenty-panda@noreply.code.forgejo.org>
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
This commit is contained in:
earl-warren 2024-03-24 11:58:34 +00:00
commit af0a149a4d

View file

@ -535,13 +535,6 @@ func (rc *RunContext) startJobContainer() common.Executor {
return nil
}
jobContainerNetwork := rc.Config.ContainerNetworkMode.NetworkName()
if rc.containerImage(ctx) != "" {
jobContainerNetwork = networkName
} else if jobContainerNetwork == "" {
jobContainerNetwork = "host"
}
rc.JobContainer = container.NewContainer(&container.NewContainerInput{
Cmd: nil,
Entrypoint: []string{"tail", "-f", "/dev/null"},
@ -552,7 +545,7 @@ func (rc *RunContext) startJobContainer() common.Executor {
Name: name,
Env: envList,
Mounts: mounts,
NetworkMode: jobContainerNetwork,
NetworkMode: networkName,
NetworkAliases: []string{rc.Name},
Binds: binds,
Stdout: logWriter,