Use of container.HostConfig.NetworkMode to detect host mode
Signed-off-by: Emile Vauge <emile@vauge.com>
This commit is contained in:
parent
6fd8979754
commit
b1ecb1f61f
2 changed files with 32 additions and 6 deletions
|
@ -269,6 +269,30 @@ func TestDockerGetIPAddress(t *testing.T) { // TODO
|
|||
},
|
||||
expected: "10.11.12.14",
|
||||
},
|
||||
{
|
||||
container: docker.ContainerJSON{
|
||||
ContainerJSONBase: &docker.ContainerJSONBase{
|
||||
Name: "bar",
|
||||
HostConfig: &container.HostConfig{
|
||||
NetworkMode: "host",
|
||||
},
|
||||
},
|
||||
Config: &container.Config{
|
||||
Labels: map[string]string{},
|
||||
},
|
||||
NetworkSettings: &docker.NetworkSettings{
|
||||
Networks: map[string]*network.EndpointSettings{
|
||||
"testnet1": {
|
||||
IPAddress: "10.11.12.13",
|
||||
},
|
||||
"testnet2": {
|
||||
IPAddress: "10.11.12.14",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
expected: "127.0.0.1",
|
||||
},
|
||||
}
|
||||
|
||||
for _, e := range containers {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue