mirror of
https://github.com/moby/moby.git
synced 2026-08-03 06:30:59 +00:00
Merge pull request #33292 from keloyang/attach-restart-check
Add a restarting check to ContainerAttach
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user