浏览代码

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)
 	}