Add support for updating Kernel Memory Limits (#256)

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
Kenfe-Mickaël Laventure 2016-06-06 11:26:07 -07:00 committed by Michael Crosby
parent 5624732128
commit 16a8dfe6a8
6 changed files with 206 additions and 167 deletions

View file

@ -597,6 +597,9 @@ var updateCommand = cli.Command{
cli.IntFlag{
Name: "kernel-limit",
},
cli.IntFlag{
Name: "kernel-tcp-limit",
},
cli.IntFlag{
Name: "blkio-weight",
},
@ -621,6 +624,8 @@ var updateCommand = cli.Command{
req.Resources.CpuShares = uint32(context.Int("cpu-shares"))
req.Resources.CpusetCpus = context.String("cpuset-cpus")
req.Resources.CpusetMems = context.String("cpuset-mems")
req.Resources.KernelMemoryLimit = uint32(context.Int("kernel-limit"))
req.Resources.KernelTCPMemoryLimit = uint32(context.Int("kernel-tcp-limit"))
c := getClient(context)
if _, err := c.UpdateContainer(netcontext.Background(), req); err != nil {
fatal(err.Error(), 1)