Add kpod pause
and kpod unpause
Implement the ability to pause and unpause running containers. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
This commit is contained in:
parent
45747cc5d0
commit
9db7cf1370
13 changed files with 444 additions and 11 deletions
|
@ -16,8 +16,11 @@ func (c *ContainerServer) Remove(container string, force bool) (string, error) {
|
|||
}
|
||||
ctrID := ctr.ID()
|
||||
|
||||
cState := c.runtime.ContainerStatus(ctr)
|
||||
if cState.Status == oci.ContainerStateCreated || cState.Status == oci.ContainerStateRunning {
|
||||
cStatus := c.runtime.ContainerStatus(ctr)
|
||||
switch cStatus.Status {
|
||||
case oci.ContainerStatePaused:
|
||||
return "", errors.Errorf("cannot remove paused container %s", ctrID)
|
||||
case oci.ContainerStateCreated, oci.ContainerStateRunning:
|
||||
if force {
|
||||
_, err = c.ContainerStop(container, -1)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue