Add HostGateway constant

Signed-off-by: Gregor Eichelberger <gregor.eichelberger@tuwien.ac.at>
This commit is contained in:
Gregor Eichelberger 2023-07-10 09:27:21 +02:00
parent 5cb0d3d121
commit 556564667a
1 changed files with 2 additions and 1 deletions

View File

@ -14,6 +14,7 @@ import (
const (
HostContainersInternal = "host.containers.internal"
HostGateway = "host-gateway"
localhost = "localhost"
)
@ -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]}}