Add support for host ip binding to the API (and kubelet)

This commit is contained in:
Brendan Burns
2014-07-08 22:44:15 -07:00
parent 9408bd77ec
commit 4b22f7a462
3 changed files with 17 additions and 1 deletions

View File

@@ -529,6 +529,7 @@ func TestMakePortsAndBindings(t *testing.T) {
{
ContainerPort: 80,
HostPort: 8080,
HostIP: "127.0.0.1",
},
{
ContainerPort: 443,
@@ -558,18 +559,30 @@ func TestMakePortsAndBindings(t *testing.T) {
if !reflect.DeepEqual(docker.Port("80/tcp"), key) {
t.Errorf("Unexpected docker port: %#v", key)
}
if value[0].HostIp != "127.0.0.1" {
t.Errorf("Unexpected host IP: %s", value[0].HostIp)
}
case "443":
if !reflect.DeepEqual(docker.Port("443/tcp"), key) {
t.Errorf("Unexpected docker port: %#v", key)
}
if value[0].HostIp != "" {
t.Errorf("Unexpected host IP: %s", value[0].HostIp)
}
case "444":
if !reflect.DeepEqual(docker.Port("444/udp"), key) {
t.Errorf("Unexpected docker port: %#v", key)
}
if value[0].HostIp != "" {
t.Errorf("Unexpected host IP: %s", value[0].HostIp)
}
case "445":
if !reflect.DeepEqual(docker.Port("445/tcp"), key) {
t.Errorf("Unexpected docker port: %#v", key)
}
if value[0].HostIp != "" {
t.Errorf("Unexpected host IP: %s", value[0].HostIp)
}
}
}
}