mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
PublishAllPorts: don't crash with nil PortBindings
Introduced by commit 85b260f ("PublishAllPorts: create
port mappings for exposed ports").
Signed-off-by: Rob Murray <rob.murray@docker.com>
This commit is contained in:
@@ -72,6 +72,13 @@ func WithSysctls(sysctls map[string]string) func(*TestContainerConfig) {
|
||||
}
|
||||
}
|
||||
|
||||
// WithPublishAllPorts sets PublishAllPorts.
|
||||
func WithPublishAllPorts(publishAll bool) func(*TestContainerConfig) {
|
||||
return func(c *TestContainerConfig) {
|
||||
c.HostConfig.PublishAllPorts = publishAll
|
||||
}
|
||||
}
|
||||
|
||||
// WithExposedPorts sets the exposed ports of the container
|
||||
func WithExposedPorts(ports ...string) func(*TestContainerConfig) {
|
||||
return func(c *TestContainerConfig) {
|
||||
|
||||
Reference in New Issue
Block a user