Merge pull request #926 from TomSweeneyRedHat/pause
Add `kpod pause` and `kpod unpause`
This commit is contained in:
commit
214adee0ef
13 changed files with 444 additions and 11 deletions
18
oci/oci.go
18
oci/oci.go
|
@ -24,6 +24,8 @@ import (
|
|||
const (
|
||||
// ContainerStateCreated represents the created state of a container
|
||||
ContainerStateCreated = "created"
|
||||
// ContainerStatePaused represents the paused state of a container
|
||||
ContainerStatePaused = "paused"
|
||||
// ContainerStateRunning represents the running state of a container
|
||||
ContainerStateRunning = "running"
|
||||
// ContainerStateStopped represents the stopped state of a container
|
||||
|
@ -696,3 +698,19 @@ func (r *Runtime) RuntimeReady() (bool, error) {
|
|||
func (r *Runtime) NetworkReady() (bool, error) {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
// PauseContainer pauses a container.
|
||||
func (r *Runtime) PauseContainer(c *Container) error {
|
||||
c.opLock.Lock()
|
||||
defer c.opLock.Unlock()
|
||||
_, err := utils.ExecCmd(r.Path(c), "pause", c.id)
|
||||
return err
|
||||
}
|
||||
|
||||
// UnpauseContainer unpauses a container.
|
||||
func (r *Runtime) UnpauseContainer(c *Container) error {
|
||||
c.opLock.Lock()
|
||||
defer c.opLock.Unlock()
|
||||
_, err := utils.ExecCmd(r.Path(c), "resume", c.id)
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue