Add pause command to ctr
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
parent
a4eece0bd1
commit
450c8223e6
1 changed files with 21 additions and 0 deletions
|
@ -48,6 +48,7 @@ var containersCommand = cli.Command{
|
||||||
execCommand,
|
execCommand,
|
||||||
killCommand,
|
killCommand,
|
||||||
listCommand,
|
listCommand,
|
||||||
|
pauseCommand,
|
||||||
startCommand,
|
startCommand,
|
||||||
statsCommand,
|
statsCommand,
|
||||||
},
|
},
|
||||||
|
@ -269,6 +270,26 @@ func attachStdio(s stdio) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var pauseCommand = cli.Command{
|
||||||
|
Name: "pause",
|
||||||
|
Usage: "pause a 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: "paused",
|
||||||
|
})
|
||||||
|
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",
|
||||||
|
|
Loading…
Reference in a new issue