From e171eda9989cb5d10e7fe14b258f239edb124541 Mon Sep 17 00:00:00 2001 From: Jessica Frazelle Date: Thu, 16 Oct 2014 16:54:55 -0700 Subject: [PATCH] fix for iptables cleanup 8307 Docker-DCO-1.1-Signed-off-by: Jessica Frazelle (github: jfrazelle) --- daemon/container.go | 4 +++- engine/job.go | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/daemon/container.go b/daemon/container.go index a477f19f22..a972f8b712 100644 --- a/daemon/container.go +++ b/daemon/container.go @@ -527,7 +527,9 @@ func (container *Container) ReleaseNetwork() { } eng := container.daemon.eng - eng.Job("release_interface", container.ID).Run() + job := eng.Job("release_interface", container.ID) + job.SetenvBool("overrideShutdown", true) + job.Run() container.NetworkSettings = &NetworkSettings{} } diff --git a/engine/job.go b/engine/job.go index ecd9441ff5..6c11b13446 100644 --- a/engine/job.go +++ b/engine/job.go @@ -48,7 +48,7 @@ const ( // If the job returns a failure status, an error is returned // which includes the status. func (job *Job) Run() error { - if job.Eng.IsShutdown() { + if job.Eng.IsShutdown() && !job.GetenvBool("overrideShutdown") { return fmt.Errorf("engine is shutdown") } // FIXME: this is a temporary workaround to avoid Engine.Shutdown