diff options
author | Travis DePrato <travisdeprato@gmail.com> | 2021-01-10 22:52:15 -0800 |
---|---|---|
committer | Travis DePrato <travisdeprato@gmail.com> | 2021-01-13 13:06:15 -0800 |
commit | 37855aff121a7cf9deae0405910a62518e806a9e (patch) | |
tree | 3ffe56f23de2ead4014ca35473c1a8f55693392d /pkg/shim/runsc | |
parent | 64bff178b8a3091a79d7a3cc7c255542fdd3fd80 (diff) |
Add support for pause/restore in containerd shim
Diffstat (limited to 'pkg/shim/runsc')
-rw-r--r-- | pkg/shim/runsc/runsc.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/pkg/shim/runsc/runsc.go b/pkg/shim/runsc/runsc.go index aedaf5ee5..e1d616d6f 100644 --- a/pkg/shim/runsc/runsc.go +++ b/pkg/shim/runsc/runsc.go @@ -167,6 +167,20 @@ func (r *Runsc) Create(context context.Context, id, bundle string, opts *CreateO return err } +func (r *Runsc) Pause(context context.Context, id string) error { + if _, err := cmdOutput(r.command(context, "pause", id), true); err != nil { + return fmt.Errorf("unable to pause: %s", err) + } + return nil +} + +func (r *Runsc) Resume(context context.Context, id string) error { + if _, err := cmdOutput(r.command(context, "pause", id), true); err != nil { + return fmt.Errorf("unable to resume: %s", err) + } + return nil +} + // Start will start an already created container. func (r *Runsc) Start(context context.Context, id string, cio runc.IO) error { cmd := r.command(context, "start", id) |