1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2025-11-23 21:44:44 +02:00

Fix IPv6 host aliases for kubernetes (#2992)

Closes #2991


[Tests](https://github.com/woodpecker-ci/woodpecker/pull/2993#issuecomment-1868048169)

---------

Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
Thomas Anderson
2023-12-23 02:42:30 +03:00
committed by GitHub
parent cd9d425a0d
commit 253d702bc7
10 changed files with 131 additions and 69 deletions

View File

@@ -88,8 +88,12 @@ func toHostConfig(step *types.Step) *container.HostConfig {
if len(step.DNSSearch) != 0 {
config.DNSSearch = step.DNSSearch
}
extraHosts := []string{}
for _, hostAlias := range step.ExtraHosts {
extraHosts = append(extraHosts, hostAlias.Name+":"+hostAlias.IP)
}
if len(step.ExtraHosts) != 0 {
config.ExtraHosts = step.ExtraHosts
config.ExtraHosts = extraHosts
}
if len(step.Devices) != 0 {
config.Devices = toDev(step.Devices)