Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
| ... | ... |
@@ -463,10 +463,12 @@ func (container *Container) allocateNetwork() error {
|
| 463 | 463 |
|
| 464 | 464 |
if container.Config.PortSpecs != nil {
|
| 465 | 465 |
if err := migratePortMappings(container.Config, container.hostConfig); err != nil {
|
| 466 |
+ eng.Job("release_interface", container.ID).Run()
|
|
| 466 | 467 |
return err |
| 467 | 468 |
} |
| 468 | 469 |
container.Config.PortSpecs = nil |
| 469 | 470 |
if err := container.WriteHostConfig(); err != nil {
|
| 471 |
+ eng.Job("release_interface", container.ID).Run()
|
|
| 470 | 472 |
return err |
| 471 | 473 |
} |
| 472 | 474 |
} |
| ... | ... |
@@ -496,6 +498,7 @@ func (container *Container) allocateNetwork() error {
|
| 496 | 496 |
|
| 497 | 497 |
for port := range portSpecs {
|
| 498 | 498 |
if err := container.allocatePort(eng, port, bindings); err != nil {
|
| 499 |
+ eng.Job("release_interface", container.ID).Run()
|
|
| 499 | 500 |
return err |
| 500 | 501 |
} |
| 501 | 502 |
} |
| ... | ... |
@@ -1149,7 +1152,6 @@ func (container *Container) allocatePort(eng *engine.Engine, port nat.Port, bind |
| 1149 | 1149 |
return err |
| 1150 | 1150 |
} |
| 1151 | 1151 |
if err := job.Run(); err != nil {
|
| 1152 |
- eng.Job("release_interface", container.ID).Run()
|
|
| 1153 | 1152 |
return err |
| 1154 | 1153 |
} |
| 1155 | 1154 |
b.HostIp = portEnv.Get("HostIP")
|