소스 검색

Add a restarting check to ContainerAttach

Signed-off-by: yangshukui <yangshukui@huawei.com>
yangshukui 8 년 전
부모
커밋
5010e09534
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      daemon/attach.go

+ 5 - 1
daemon/attach.go

@@ -31,7 +31,11 @@ func (daemon *Daemon) ContainerAttach(prefixOrName string, c *backend.ContainerA
 		return err
 	}
 	if container.IsPaused() {
-		err := fmt.Errorf("Container %s is paused. Unpause the container before attach", prefixOrName)
+		err := fmt.Errorf("Container %s is paused, unpause the container before attach.", prefixOrName)
+		return errors.NewRequestConflictError(err)
+	}
+	if container.IsRestarting() {
+		err := fmt.Errorf("Container %s is restarting, wait until the container is running.", prefixOrName)
 		return errors.NewRequestConflictError(err)
 	}