Add a flag for specifying system properties.
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
parent
3e661186ba
commit
b38cce017b
|
@ -44,6 +44,7 @@ var createFlags = []cli.Flag{
|
||||||
cli.StringFlag{Name: "veth-gateway", Usage: "veth gateway address"},
|
cli.StringFlag{Name: "veth-gateway", Usage: "veth gateway address"},
|
||||||
cli.IntFlag{Name: "veth-mtu", Usage: "veth mtu"},
|
cli.IntFlag{Name: "veth-mtu", Usage: "veth mtu"},
|
||||||
cli.BoolFlag{Name: "cgroup", Usage: "mount the cgroup data for the container"},
|
cli.BoolFlag{Name: "cgroup", Usage: "mount the cgroup data for the container"},
|
||||||
|
cli.StringSliceFlag{Name: "sysctl", Value: &cli.StringSlice{}, Usage: "set system properties in the container"},
|
||||||
}
|
}
|
||||||
|
|
||||||
var configCommand = cli.Command{
|
var configCommand = cli.Command{
|
||||||
|
@ -111,6 +112,14 @@ func modify(config *configs.Config, context *cli.Context) {
|
||||||
node.Gid = uint32(userns_uid)
|
node.Gid = uint32(userns_uid)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
config.SystemProperties = make(map[string]string)
|
||||||
|
for _, sysProp := range context.StringSlice("sysctl") {
|
||||||
|
parts := strings.SplitN(sysProp, "=", 2)
|
||||||
|
if len(parts) != 2 {
|
||||||
|
logrus.Fatalf("invalid system property %s", sysProp)
|
||||||
|
}
|
||||||
|
config.SystemProperties[parts[0]] = parts[1]
|
||||||
|
}
|
||||||
for _, rawBind := range context.StringSlice("bind") {
|
for _, rawBind := range context.StringSlice("bind") {
|
||||||
mount := &configs.Mount{
|
mount := &configs.Mount{
|
||||||
Device: "bind",
|
Device: "bind",
|
||||||
|
|
Loading…
Reference in New Issue