Add resume command to ctr
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
parent
450c8223e6
commit
d0ab285704
1 changed files with 21 additions and 0 deletions
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue