summaryrefslogtreecommitdiffhomepage
path: root/pkg/shim/runsc/runsc.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-01-15 10:09:43 -0800
committergVisor bot <gvisor-bot@google.com>2021-01-15 10:09:43 -0800
commit714a020ab5cc56f61f92f407212209628f43c46b (patch)
treeab3da366043a8c5dd28ccf770fa9d28b9a6a4590 /pkg/shim/runsc/runsc.go
parente57ebcd37a7b9f98d80e594f2c0baf2220d7b830 (diff)
parenta88d6caf533e11d3171232e415f106475e5b3f08 (diff)
Merge pull request #5237 from travigd:add-containerd-pause
PiperOrigin-RevId: 352032380
Diffstat (limited to 'pkg/shim/runsc/runsc.go')
-rw-r--r--pkg/shim/runsc/runsc.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/pkg/shim/runsc/runsc.go b/pkg/shim/runsc/runsc.go
index aedaf5ee5..3c4cbf223 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: %w", err)
+ }
+ return nil
+}
+
+func (r *Runsc) Resume(context context.Context, id string) error {
+ if _, err := cmdOutput(r.command(context, "resume", id), true); err != nil {
+ return fmt.Errorf("unable to resume: %w", 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)