1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

export portmapping in network.go

This commit is contained in:
Victor Vieux 2013-07-10 14:09:35 +00:00
parent e962e9edcf
commit d918c7d9de

View file

@ -202,14 +202,14 @@ func ParseRun(args []string, capabilities *Capabilities) (*Config, *HostConfig,
return config, hostConfig, cmd, nil
}
type portMapping map[string]string
type PortMapping map[string]string
type NetworkSettings struct {
IPAddress string
IPPrefixLen int
Gateway string
Bridge string
PortMapping map[string]portMapping
PortMapping map[string]PortMapping
}
// String returns a human-readable description of the port mapping defined in the settings
@ -693,9 +693,9 @@ func (container *Container) allocateNetwork() error {
if err != nil {
return err
}
container.NetworkSettings.PortMapping = make(map[string]portMapping)
container.NetworkSettings.PortMapping["Tcp"] = make(portMapping)
container.NetworkSettings.PortMapping["Udp"] = make(portMapping)
container.NetworkSettings.PortMapping = make(map[string]PortMapping)
container.NetworkSettings.PortMapping["Tcp"] = make(PortMapping)
container.NetworkSettings.PortMapping["Udp"] = make(PortMapping)
for _, spec := range container.Config.PortSpecs {
nat, err := iface.AllocatePort(spec)
if err != nil {