mirror of
https://github.com/kreuzwerker/terraform-provider-docker.git
synced 2025-12-28 10:39:42 -05:00
feat: conditionally adding port binding (#293).
Set external = 0 to assign a random external port. Closes #255 Co-authored-by: Nolan Woods <nolan_w@sfu.ca>
This commit is contained in:
parent
4e9cab18a7
commit
5d1e55cf1b
1 changed files with 3 additions and 1 deletions
|
|
@ -930,7 +930,9 @@ func portSetToDockerPorts(ports []interface{}) (map[nat.Port]struct{}, map[nat.P
|
|||
portBinding.HostIP = ip
|
||||
}
|
||||
|
||||
retPortBindings[exposedPort] = append(retPortBindings[exposedPort], portBinding)
|
||||
if extOk || ipOk {
|
||||
retPortBindings[exposedPort] = append(retPortBindings[exposedPort], portBinding)
|
||||
}
|
||||
}
|
||||
|
||||
return retExposedPorts, retPortBindings
|
||||
|
|
|
|||
Loading…
Reference in a new issue