Add resume command to ctr

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
Kenfe-Mickael Laventure 2016-02-25 10:10:05 -08:00
parent 450c8223e6
commit d0ab285704

View file

@ -49,6 +49,7 @@ var containersCommand = cli.Command{
killCommand, killCommand,
listCommand, listCommand,
pauseCommand, pauseCommand,
resumeCommand,
startCommand, startCommand,
statsCommand, 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{ var killCommand = cli.Command{
Name: "kill", Name: "kill",
Usage: "send a signal to a container or its processes", Usage: "send a signal to a container or its processes",