Skip to content

Commit f004763

Browse files
author
Felix
committed
#52 Deploy container default custom ports
1 parent c4adcf7 commit f004763

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main/scala/ui/widgets/dialogs/ContainerRequestForm.scala

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,13 @@ object ContainerRequestForm {
8181
HostConfig = hostConfig.copy(
8282
PublishAllPorts = false,
8383
PortBindings = t.props.initialConfig.portBindings.map { case (containerPort, host) =>
84-
(containerPort, if (host.isEmpty) Seq(NetworkSettingsPort(HostIp = "", HostPort = "")) else host)
84+
val allPorts = if (host.isEmpty) Seq(NetworkSettingsPort(HostIp = "", HostPort = "")) else host
85+
val hostPortsWithDefault = allPorts.map {
86+
case NetworkSettingsPort(ip, "") => NetworkSettingsPort(ip, containerPort.takeWhile(_ != '/'))
87+
case other => other
88+
}
89+
90+
(containerPort, hostPortsWithDefault)
8591
}
8692
)
8793
)

0 commit comments

Comments
 (0)