convertExtraHosts converts : mappings to SwarmKit notation: "IP-address hostname(s)". The original order of mappings is preserved.
(extraHosts composetypes.HostsList)
| 420 | // convertExtraHosts converts <host>:<ip> mappings to SwarmKit notation: |
| 421 | // "IP-address hostname(s)". The original order of mappings is preserved. |
| 422 | func convertExtraHosts(extraHosts composetypes.HostsList) []string { |
| 423 | hosts := make([]string, 0, len(extraHosts)) |
| 424 | for _, hostIP := range extraHosts { |
| 425 | if hostName, ipAddr, ok := strings.Cut(hostIP, ":"); ok { |
| 426 | // Convert to SwarmKit notation: IP-address hostname(s) |
| 427 | hosts = append(hosts, ipAddr+" "+hostName) |
| 428 | } |
| 429 | } |
| 430 | return hosts |
| 431 | } |
| 432 | |
| 433 | func convertHealthcheck(healthcheck *composetypes.HealthCheckConfig) (*container.HealthConfig, error) { |
| 434 | if healthcheck == nil { |
no outgoing calls
searching dependent graphs…