Skip to content

Commit

Permalink
Add HostGateway constant
Browse files Browse the repository at this point in the history
Signed-off-by: Gregor Eichelberger <[email protected]>
  • Loading branch information
geichelberger committed Jul 10, 2023
1 parent 6674663 commit 870255d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libnetwork/etchosts/hosts.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

const (
HostContainersInternal = "host.containers.internal"
HostGateway = "host-gateway"
localhost = "localhost"
)

Expand Down Expand Up @@ -244,7 +245,7 @@ func parseExtraHosts(extraHosts []string, hostContainersInternalIP string) (Host
return nil, fmt.Errorf("IP address in host entry %q is empty", entry)
}
ip := values[1]
if values[1] == "host-gateway" {
if values[1] == HostGateway {
ip = hostContainersInternalIP
}
e := HostEntry{IP: ip, Names: []string{values[0]}}
Expand Down

0 comments on commit 870255d

Please sign in to comment.