浏览代码

fix for iptables cleanup 8307

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Jessica Frazelle 10 年之前
父节点
当前提交
e171eda998
共有 2 个文件被更改,包括 4 次插入2 次删除
  1. 3 1
      daemon/container.go
  2. 1 1
      engine/job.go

+ 3 - 1
daemon/container.go

@@ -527,7 +527,9 @@ func (container *Container) ReleaseNetwork() {
 	}
 	}
 	eng := container.daemon.eng
 	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{}
 	container.NetworkSettings = &NetworkSettings{}
 }
 }
 
 

+ 1 - 1
engine/job.go

@@ -48,7 +48,7 @@ const (
 // If the job returns a failure status, an error is returned
 // If the job returns a failure status, an error is returned
 // which includes the status.
 // which includes the status.
 func (job *Job) Run() error {
 func (job *Job) Run() error {
-	if job.Eng.IsShutdown() {
+	if job.Eng.IsShutdown() && !job.GetenvBool("overrideShutdown") {
 		return fmt.Errorf("engine is shutdown")
 		return fmt.Errorf("engine is shutdown")
 	}
 	}
 	// FIXME: this is a temporary workaround to avoid Engine.Shutdown
 	// FIXME: this is a temporary workaround to avoid Engine.Shutdown