Update allocations.go
This commit is contained in:
parent
e7d93a5248
commit
da4c542724
|
@ -43,17 +43,11 @@ func (a *Allocations) Bindings() nat.PortMap {
|
||||||
HostPort: strconv.Itoa(port),
|
HostPort: strconv.Itoa(port),
|
||||||
}
|
}
|
||||||
|
|
||||||
if v, ok := out[nat.Port(fmt.Sprintf("%d/tcp", port))]; ok {
|
tcp := nat.Port(fmt.Sprintf("%d/tcp", port))
|
||||||
out[nat.Port(fmt.Sprintf("%d/tcp", port))] = append(v, binding)
|
udp := nat.Port(fmt.Sprintf("%d/udp", port))
|
||||||
} else {
|
|
||||||
out[nat.Port(fmt.Sprintf("%d/tcp", port))] = []nat.PortBinding{binding}
|
|
||||||
}
|
|
||||||
|
|
||||||
if v, ok := out[nat.Port(fmt.Sprintf("%d/udp", port))]; ok {
|
out[tcp] = append(out[tcp], binding)
|
||||||
out[nat.Port(fmt.Sprintf("%d/udp", port))] = append(v, binding)
|
out[udp] = append(out[udp], binding)
|
||||||
} else {
|
|
||||||
out[nat.Port(fmt.Sprintf("%d/udp", port))] = []nat.PortBinding{binding}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user