mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-08-11 17:50:58 +00:00
fix: (#2075)
network-scoped alias is supported only for containers in user defined networks Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
parent
d2b2ed2d66
commit
78a021bc14
1 changed files with 3 additions and 1 deletions
|
@ -447,7 +447,9 @@ func (cr *containerReference) create(capAdd []string, capDrop []string) common.E
|
|||
|
||||
var networkingConfig *network.NetworkingConfig
|
||||
logger.Debugf("input.NetworkAliases ==> %v", input.NetworkAliases)
|
||||
if hostConfig.NetworkMode.IsUserDefined() && len(input.NetworkAliases) > 0 {
|
||||
n := hostConfig.NetworkMode
|
||||
// TODO: use IsUserDefined() once it's windows implementation matches the unix one
|
||||
if !n.IsDefault() && !n.IsBridge() && !n.IsHost() && !n.IsNone() && !n.IsContainer() && len(input.NetworkAliases) > 0 {
|
||||
endpointConfig := &network.EndpointSettings{
|
||||
Aliases: input.NetworkAliases,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue