Browse code

fix for iptables cleanup 8307

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)

Jessica Frazelle authored on 2014/10/17 08:54:55
Showing 2 changed files
... ...
@@ -527,7 +527,9 @@ func (container *Container) ReleaseNetwork() {
527 527
 	}
528 528
 	eng := container.daemon.eng
529 529
 
530
-	eng.Job("release_interface", container.ID).Run()
530
+	job := eng.Job("release_interface", container.ID)
531
+	job.SetenvBool("overrideShutdown", true)
532
+	job.Run()
531 533
 	container.NetworkSettings = &NetworkSettings{}
532 534
 }
533 535
 
... ...
@@ -48,7 +48,7 @@ const (
48 48
 // If the job returns a failure status, an error is returned
49 49
 // which includes the status.
50 50
 func (job *Job) Run() error {
51
-	if job.Eng.IsShutdown() {
51
+	if job.Eng.IsShutdown() && !job.GetenvBool("overrideShutdown") {
52 52
 		return fmt.Errorf("engine is shutdown")
53 53
 	}
54 54
 	// FIXME: this is a temporary workaround to avoid Engine.Shutdown