refactor(hosts): export hostContainersInternal variable

Because we need to use the value of this variable in podman, exporting this variable means we don't have to hardcode this string in podman. This will make the code easier to maintain.

Signed-off-by: Black-Hole1 <bh@bugs.cc>
This commit is contained in:
Black-Hole1 2023-06-20 14:00:57 +08:00
parent f40c21a4b5
commit ab16e8d843
1 changed files with 2 additions and 2 deletions

View File

@ -13,7 +13,7 @@ import (
)
const (
hostContainersInternal = "host.containers.internal"
HostContainersInternal = "host.containers.internal"
localhost = "localhost"
)
@ -118,7 +118,7 @@ func newHost(params *Params) error {
l2 := HostEntry{IP: "::1", Names: lh}
containerIPs = append(containerIPs, l1, l2)
if params.HostContainersInternalIP != "" {
e := HostEntry{IP: params.HostContainersInternalIP, Names: []string{hostContainersInternal}}
e := HostEntry{IP: params.HostContainersInternalIP, Names: []string{HostContainersInternal}}
containerIPs = append(containerIPs, e)
}
containerIPs = append(containerIPs, params.ContainerIPs...)