Skip to content

Commit e48c6d7

Browse files
committed
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>
1 parent 410d8cb commit e48c6d7

File tree

1 file changed

+4
-6
lines changed
  • pkg/provision/providers/docker

1 file changed

+4
-6
lines changed

pkg/provision/providers/docker/node.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -320,12 +320,10 @@ func genPortMap(portList []string, defaultHostIP string) (portMap, error) {
320320
}
321321

322322
portSetRet[natPort] = struct{}{}
323-
portMapRet[natPort] = []network.PortBinding{
324-
{
325-
HostIP: hostAddr,
326-
HostPort: hostPort,
327-
},
328-
}
323+
portMapRet[natPort] = append(portMapRet[natPort], network.PortBinding{
324+
HostIP: hostAddr,
325+
HostPort: hostPort,
326+
})
329327
}
330328

331329
return portMap{portSetRet, portMapRet}, nil

0 commit comments

Comments
 (0)