Add a restarting check to ContainerAttach
Signed-off-by: yangshukui <yangshukui@huawei.com>
This commit is contained in:
parent
77c9728847
commit
5010e09534
1 changed files with 5 additions and 1 deletions
|
@ -31,7 +31,11 @@ func (daemon *Daemon) ContainerAttach(prefixOrName string, c *backend.ContainerA
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if container.IsPaused() {
|
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)
|
return errors.NewRequestConflictError(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue