From d0ab28570443ca39b2cb942822b32364f4ddfa17 Mon Sep 17 00:00:00 2001 From: Kenfe-Mickael Laventure Date: Thu, 25 Feb 2016 10:10:05 -0800 Subject: [PATCH] Add resume command to ctr Signed-off-by: Kenfe-Mickael Laventure --- ctr/container.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ctr/container.go b/ctr/container.go index 70acd0e..b6900af 100644 --- a/ctr/container.go +++ b/ctr/container.go @@ -49,6 +49,7 @@ var containersCommand = cli.Command{ killCommand, listCommand, pauseCommand, + resumeCommand, startCommand, statsCommand, }, @@ -290,6 +291,26 @@ var pauseCommand = cli.Command{ }, } +var resumeCommand = cli.Command{ + Name: "resume", + Usage: "resume a paused container", + Action: func(context *cli.Context) { + id := context.Args().First() + if id == "" { + fatal("container id cannot be empty", 1) + } + c := getClient(context) + _, err := c.UpdateContainer(netcontext.Background(), &types.UpdateContainerRequest{ + Id: id, + Pid: "init", + Status: "running", + }) + if err != nil { + fatal(err.Error(), 1) + } + }, +} + var killCommand = cli.Command{ Name: "kill", Usage: "send a signal to a container or its processes",