mirror of
https://github.com/containers/podman.git
synced 2025-12-11 17:27:19 +08:00
vendor latest c/common
Includes my pasta changes. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
10
vendor/github.com/containers/common/libnetwork/etchosts/hosts.go
generated
vendored
10
vendor/github.com/containers/common/libnetwork/etchosts/hosts.go
generated
vendored
@@ -229,9 +229,10 @@ func checkIfEntryExists(current HostEntry, entries HostEntries) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// parseExtraHosts converts a slice of "name:ip" string to entries.
|
||||
// Because podman and buildah both store the extra hosts in this format
|
||||
// we convert it here instead of having to this on the caller side.
|
||||
// parseExtraHosts converts a slice of "name1;name2;name3:ip" string to entries.
|
||||
// Each entry can contain one or more hostnames separated by semicolons and an IP address separated by a colon.
|
||||
// Because podman and buildah both store the extra hosts in this format,
|
||||
// we convert it here instead of having to do this on the caller side.
|
||||
func parseExtraHosts(extraHosts []string, hostContainersInternalIP string) (HostEntries, error) {
|
||||
entries := make(HostEntries, 0, len(extraHosts))
|
||||
for _, entry := range extraHosts {
|
||||
@@ -252,7 +253,8 @@ func parseExtraHosts(extraHosts []string, hostContainersInternalIP string) (Host
|
||||
}
|
||||
ip = hostContainersInternalIP
|
||||
}
|
||||
e := HostEntry{IP: ip, Names: []string{values[0]}}
|
||||
names := strings.Split(values[0], ";")
|
||||
e := HostEntry{IP: ip, Names: names}
|
||||
entries = append(entries, e)
|
||||
}
|
||||
return entries, nil
|
||||
|
||||
Reference in New Issue
Block a user