소스 검색

fix #29199, reset container if container start failed

Signed-off-by: Lei Jitang <leijitang@huawei.com>
Lei Jitang 8 년 전
부모
커밋
e806821b53
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      daemon/start.go

+ 3 - 2
daemon/start.go

@@ -119,6 +119,9 @@ func (daemon *Daemon) containerStart(container *container.Container, checkpoint
 				container.SetExitCode(128)
 			}
 			container.ToDisk()
+
+			container.Reset(false)
+
 			daemon.Cleanup(container)
 			// if containers AutoRemove flag is set, remove it after clean up
 			if container.HostConfig.AutoRemove {
@@ -187,8 +190,6 @@ func (daemon *Daemon) containerStart(container *container.Container, checkpoint
 			container.SetExitCode(127)
 		}
 
-		container.Reset(false)
-
 		return fmt.Errorf("%s", errDesc)
 	}