mirror of
https://github.com/siderolabs/talos.git
synced 2026-05-05 04:16:21 +02:00
fix: allow to expose a port multiple times in Docker
This change prevents user-specified exposed ports from overriding the default ones. This allows one e.g. to export the Kubernetes endpoint both at the default random port and at a specified host address. Signed-off-by: Dmitrii Sharshakov <dmitry.sharshakov@siderolabs.com>
This commit is contained in:
parent
410d8cb572
commit
e48c6d7ab9
@ -320,12 +320,10 @@ func genPortMap(portList []string, defaultHostIP string) (portMap, error) {
|
||||
}
|
||||
|
||||
portSetRet[natPort] = struct{}{}
|
||||
portMapRet[natPort] = []network.PortBinding{
|
||||
{
|
||||
HostIP: hostAddr,
|
||||
HostPort: hostPort,
|
||||
},
|
||||
}
|
||||
portMapRet[natPort] = append(portMapRet[natPort], network.PortBinding{
|
||||
HostIP: hostAddr,
|
||||
HostPort: hostPort,
|
||||
})
|
||||
}
|
||||
|
||||
return portMap{portSetRet, portMapRet}, nil
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user