mirror of https://github.com/containers/podman.git
You can only attach to running containers
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #98 Approved by: mheon
This commit is contained in:
parent
95cb7a11f1
commit
1f482c9f1f
|
@ -598,11 +598,9 @@ func (c *Container) Attach(noStdin bool, keys string, attached chan<- bool) erro
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO is it valid to attach to a frozen container?
|
if c.state.State != ContainerStateCreated &&
|
||||||
if c.state.State == ContainerStateUnknown ||
|
c.state.State != ContainerStateRunning {
|
||||||
c.state.State == ContainerStateConfigured ||
|
return errors.Wrapf(ErrCtrStateInvalid, "can only attach to created or running containers")
|
||||||
c.state.State == ContainerStatePaused {
|
|
||||||
return errors.Wrapf(ErrCtrStateInvalid, "can only attach to created, running, or stopped containers")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check the validity of the provided keys first
|
// Check the validity of the provided keys first
|
||||||
|
|
Loading…
Reference in New Issue