1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-08-11 17:50:58 +00:00

[FORGEJO] a network of "" is not the same as "host"

The comment that introduced this change suggests it was motivated by a
border case by which the image would be empty. It is however unclear
why it should have any impact on how the network name is determined.

The hunk is reverted.

https://github.com/nektos/act/pull/1949/files#r1315163582
This commit is contained in:
Earl Warren 2024-03-24 11:56:42 +01:00
parent 18b78d6299
commit eb76c80193

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,