1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

swap position of "host" and "ip"

the service definition uses the format as defined
in  http://man7.org/linux/man-pages/man5/hosts.5.html
(IP_address canonical_hostname [aliases...])

This format is the _reverse_ of the format used in
the container API.

Commit f32869d956
inadvertently used the incorrect order.

This fixes the order, and correctly sets it to;

    IP-Address hostname

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f1b9df9172)
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
This commit is contained in:
Sebastiaan van Stijn 2016-11-18 22:04:27 +01:00 committed by Victor Vieux
parent 47ccfcc09f
commit c4fd597ab3

View file

@ -531,7 +531,7 @@ func convertService(
func convertExtraHosts(extraHosts map[string]string) []string {
hosts := []string{}
for host, ip := range extraHosts {
hosts = append(hosts, fmt.Sprintf("%s %s", host, ip))
hosts = append(hosts, fmt.Sprintf("%s %s", ip, host))
}
return hosts
}