From 8ea6c65d12c27d484b2bcc417c3c5c42e2c159dd Mon Sep 17 00:00:00 2001 From: Mrunal Patel Date: Mon, 6 Jul 2015 19:18:08 -0400 Subject: [PATCH] Rename SystemProperties to Sysctl and make it available in the runc config Signed-off-by: Mrunal Patel --- libcontainer/configs/config.go | 4 ++-- libcontainer/integration/exec_test.go | 4 ++-- libcontainer/standard_init_linux.go | 2 +- spec.go | 1 + 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/libcontainer/configs/config.go b/libcontainer/configs/config.go index 04ea91ffd09..83381c84c20 100644 --- a/libcontainer/configs/config.go +++ b/libcontainer/configs/config.go @@ -135,9 +135,9 @@ type Config struct { // so that these files prevent any writes. ReadonlyPaths []string `json:"readonly_paths"` - // SystemProperties is a map of properties and their values. It is the equivalent of using + // Sysctl is a map of properties and their values. It is the equivalent of using // sysctl -w my.property.name value in Linux. - SystemProperties map[string]string `json:"system_properties"` + Sysctl map[string]string `json:"sysctl"` // Seccomp allows actions to be taken whenever a syscall is made within the container. // By default, all syscalls are allowed with actions to allow, trap, kill, or return an errno diff --git a/libcontainer/integration/exec_test.go b/libcontainer/integration/exec_test.go index c14c659f15a..8811863866c 100644 --- a/libcontainer/integration/exec_test.go +++ b/libcontainer/integration/exec_test.go @@ -753,7 +753,7 @@ func TestMountCmds(t *testing.T) { } } -func TestSystemProperties(t *testing.T) { +func TestSysctl(t *testing.T) { if testing.Short() { return } @@ -766,7 +766,7 @@ func TestSystemProperties(t *testing.T) { defer remove(rootfs) config := newTemplateConfig(rootfs) - config.SystemProperties = map[string]string{ + config.Sysctl = map[string]string{ "kernel.shmmni": "8192", } diff --git a/libcontainer/standard_init_linux.go b/libcontainer/standard_init_linux.go index 74a32293424..b399aa5d1f9 100644 --- a/libcontainer/standard_init_linux.go +++ b/libcontainer/standard_init_linux.go @@ -65,7 +65,7 @@ func (l *linuxStandardInit) Init() error { return err } - for key, value := range l.config.Config.SystemProperties { + for key, value := range l.config.Config.Sysctl { if err := writeSystemProperty(key, value); err != nil { return err } diff --git a/spec.go b/spec.go index 4a31f02d1c9..ec36cfbcf33 100644 --- a/spec.go +++ b/spec.go @@ -211,6 +211,7 @@ func createLibcontainerConfig(spec *specs.LinuxSpec) (*configs.Config, error) { "/proc/sys", "/proc/sysrq-trigger", "/proc/irq", "/proc/bus", } } + config.Sysctl = spec.Linux.Sysctl return config, nil }