Signed-off-by: Alessandro Boch <aboch@docker.com>
| ... | ... |
@@ -513,13 +513,23 @@ func (container *Container) buildPortMapInfo(n libnetwork.Network, ep libnetwork |
| 513 | 513 |
networkSettings.MacAddress = mac.(net.HardwareAddr).String() |
| 514 | 514 |
} |
| 515 | 515 |
|
| 516 |
+ networkSettings.Ports = nat.PortMap{}
|
|
| 517 |
+ |
|
| 518 |
+ if expData, ok := driverInfo[netlabel.ExposedPorts]; ok {
|
|
| 519 |
+ if exposedPorts, ok := expData.([]types.TransportPort); ok {
|
|
| 520 |
+ for _, tp := range exposedPorts {
|
|
| 521 |
+ natPort := nat.NewPort(tp.Proto.String(), strconv.Itoa(int(tp.Port))) |
|
| 522 |
+ networkSettings.Ports[natPort] = nil |
|
| 523 |
+ } |
|
| 524 |
+ } |
|
| 525 |
+ } |
|
| 526 |
+ |
|
| 516 | 527 |
mapData, ok := driverInfo[netlabel.PortMap] |
| 517 | 528 |
if !ok {
|
| 518 | 529 |
return networkSettings, nil |
| 519 | 530 |
} |
| 520 | 531 |
|
| 521 | 532 |
if portMapping, ok := mapData.([]types.PortBinding); ok {
|
| 522 |
- networkSettings.Ports = nat.PortMap{}
|
|
| 523 | 533 |
for _, pp := range portMapping {
|
| 524 | 534 |
natPort := nat.NewPort(pp.Proto.String(), strconv.Itoa(int(pp.Port))) |
| 525 | 535 |
natBndg := nat.PortBinding{HostIp: pp.HostIP.String(), HostPort: strconv.Itoa(int(pp.HostPort))}
|
| ... | ... |
@@ -55,7 +55,7 @@ clone hg code.google.com/p/go.net 84a4013f96e0 |
| 55 | 55 |
clone hg code.google.com/p/gosqlite 74691fb6f837 |
| 56 | 56 |
|
| 57 | 57 |
#get libnetwork packages |
| 58 |
-clone git github.com/docker/libnetwork 005bc475ee49a36ef2ad9c112d1b5ccdaba277d4 |
|
| 58 |
+clone git github.com/docker/libnetwork f72ad20491e8c46d9664da3f32a0eddb301e7c8d |
|
| 59 | 59 |
clone git github.com/vishvananda/netns 008d17ae001344769b031375bdb38a86219154c6 |
| 60 | 60 |
clone git github.com/vishvananda/netlink 8eb64238879fed52fd51c5b30ad20b928fb4c36c |
| 61 | 61 |
|
| ... | ... |
@@ -686,6 +686,15 @@ func (d *driver) EndpointOperInfo(nid, eid types.UUID) (map[string]interface{},
|
| 686 | 686 |
|
| 687 | 687 |
m := make(map[string]interface{})
|
| 688 | 688 |
|
| 689 |
+ if ep.config.ExposedPorts != nil {
|
|
| 690 |
+ // Return a copy of the config data |
|
| 691 |
+ epc := make([]types.TransportPort, 0, len(ep.config.ExposedPorts)) |
|
| 692 |
+ for _, tp := range ep.config.ExposedPorts {
|
|
| 693 |
+ epc = append(epc, tp.GetCopy()) |
|
| 694 |
+ } |
|
| 695 |
+ m[netlabel.ExposedPorts] = epc |
|
| 696 |
+ } |
|
| 697 |
+ |
|
| 689 | 698 |
if ep.portMapping != nil {
|
| 690 | 699 |
// Return a copy of the operational data |
| 691 | 700 |
pmc := make([]types.PortBinding, 0, len(ep.portMapping)) |