allocateNetwork: don't assign unneeded variables
allocateNetwork() can return early, in which case these variables were unused. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
b98b8df886
commit
84ef60cba2
1 changed files with 5 additions and 3 deletions
|
@ -527,13 +527,15 @@ func (daemon *Daemon) updateContainerNetworkSettings(container *container.Contai
|
|||
}
|
||||
|
||||
func (daemon *Daemon) allocateNetwork(container *container.Container) (retErr error) {
|
||||
start := time.Now()
|
||||
controller := daemon.netController
|
||||
|
||||
if daemon.netController == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
start = time.Now()
|
||||
controller = daemon.netController
|
||||
)
|
||||
|
||||
// Cleanup any stale sandbox left over due to ungraceful daemon shutdown
|
||||
if err := controller.SandboxDestroy(container.ID); err != nil {
|
||||
logrus.Errorf("failed to cleanup up stale network sandbox for container %s", container.ID)
|
||||
|
|
Loading…
Add table
Reference in a new issue