Signed-off-by: yangshukui <yangshukui@huawei.com>
| ... | ... |
@@ -31,7 +31,11 @@ func (daemon *Daemon) ContainerAttach(prefixOrName string, c *backend.ContainerA |
| 31 | 31 |
return err |
| 32 | 32 |
} |
| 33 | 33 |
if container.IsPaused() {
|
| 34 |
- err := fmt.Errorf("Container %s is paused. Unpause the container before attach", prefixOrName)
|
|
| 34 |
+ err := fmt.Errorf("Container %s is paused, unpause the container before attach.", prefixOrName)
|
|
| 35 |
+ return errors.NewRequestConflictError(err) |
|
| 36 |
+ } |
|
| 37 |
+ if container.IsRestarting() {
|
|
| 38 |
+ err := fmt.Errorf("Container %s is restarting, wait until the container is running.", prefixOrName)
|
|
| 35 | 39 |
return errors.NewRequestConflictError(err) |
| 36 | 40 |
} |
| 37 | 41 |
|